New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get apns4erl integrated with ejabberd #45
Comments
Yes, you can do it as you define. Create the hook for offline with the highest priority (and the lowest number to be sure is running before mod_offline) and send the push notification. You'll also need a mechanism to register the tokens and retrieve them, and in the start of the module you can configure the connection getting the configuration params from the configuration of the module. Remember to add the dependency in the rebar.config or rebar.config.script (depends if you want to use mongooseim or ejabberd). Pretty easy :-) |
Thank you for your response. Right now, I am trying to figure out how to write the hook. When I was looking at the code for apns4erl, it requires sys.config. Would you know where would I plug that in Ejabberd framework. Also, please shed some more light on rebar.config part. What is that?? Thanks again Right now, I wish I was you so that I could find it easy to do....just a light note!!!! |
No, is not needed to use sys.config, you can use the connect with all the params and get the params from the module configuration using |
@monkeyfdude when you figure it out, feel free to add a wiki page describing the process if you feel like it :) |
I will add my findings to wiki. https://github.com/inaka/apns4erl/wiki/Ejabberd-with-apns4erl |
I think I am able to connect using apns:connect. How can I check if its a persistent connection? Would it show up in netstat -ln....is there a timeout of inactivity on these connections?? I did get this in server logs: <0.380.0> Feedback server disconnected. Waiting 18000000 millis to connect again... |
I get this error in ejabberd logs gen_server 'test-connection' terminated with reason: {'module could not be loaded',[{jiffy,encode,[{[{<<"aps">>,{[{<<"sound">>,<<"chime">>} First I did not find jiffy in ejabberd. Then I tried copying jiffy.so from apns4erl to $EJABBERD_ROOT/./lib/ejabberd/priv/lib/jiffy.so But it did not help me. EDIT: I was able to resolve via processone/ejabberd#102 make distclean |
I can successful send push notifications to my device using apns4erl...closing resolved. I may have other reliability related questions that I will ask in separate tickets Thank you all for your help and support....no words can express it!!!! |
I am new to erlang and ejabberd. I have gone through docs and tutorials on erlang and ejabberd.
I am still not sure how to integrate apns4erl with ejabberd. I need to be able to do the following:
Would you be able to give me starting pointers on to get apns4erl started with ejabberd??
Do I need to start apns4erl application from my custom module that I will hook with ejabberd. is that how it will work??
Thanks in advance!
Gaurav Jain
The text was updated successfully, but these errors were encountered: