Add Push Notification to iOS Chat with Ejabberd Server
- Mobile
- Product & platform Engineering
Add Push Notification to iOS Chat with Ejabberd Server
Why to Use :
Push notification helps the app to notify users regarding occurrence of any new event. Like in Chat Client, if the user is in offline mode or the app is in idle state and gets some new chat(s) then integration of push notification with chat server will make the app more user friendly and supportive. This blog describes steps of integration of push notification to iOS chat client with ejabberd server.
Pre Request :
First of all we need to download that module from git link .
https://github.com/mrDoctorWho/ejabberd_mod_apns
Implementation:
After download we need to put that file it in the ejabberd/src directory
Then run the default compiler. After running defult compiler, system generate .beam file .
Copy generated .beam files from the ebin directory.
Change in configuration file :
We need to add this code in module section:
mod_apns: address: "gateway.push.apple.com" port: 2195 certfile: "cert.pem" keyfile: "key.pem"
and You need to send this stanza to the server over the XMPP connection, to let the server know your client token:
<iq to="YourServer" type="set"> <register xmlns="https://apple.com/push" > <token>TOKEN</token> </register> </iq>
Compatibility :
Module work fine with Ejabberd 14 and 15.
There is at least one known issue with Ejabberd 16 which can be solved by changing all calls to the xml module by calls to fxml. There is no support for both versions so far.
Literally, you need to change this:
Type = xml:get_tag_attr_s(<<"type">>, Packet), To this: Type = fxml:get_tag_attr_s(<<"type">>, Packet),
Related content
Toll mangement and command centre with TMCC
We’re passionately committed to helping our clients and their customers thrive, working side by side to drive customer value and results..
A Smarter Health Safety Solution
We’re passionately committed to helping our clients and their customers thrive, working side by side to drive customer value and results..
Building fastest loan portal in India
We’re passionately committed to helping our clients and their customers thrive, working side by side to drive customer value and results..
Toll mangement and command centre with TMCC
We’re passionately committed to helping our clients and their customers thrive, working side by side to drive customer value and results...
Toll mangement and command centre with TMCC
We’re passionately committed to helping our clients and their customers thrive, working side by side to drive customer value and results..
Entreprise IT Transformation and Automation
We understand user and market, create product strategy and design experience for customers and employees to make breakthrough digital products and services