Skip to content

An ejabberd module to send PUSH messages to iOS devices through APNS

License

Notifications You must be signed in to change notification settings

karunreddy30/ejabberd_mod_apns

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mod_apns

Fork Me Now! Spread the project for great good!

An ejabberd module to send offline messages as PUSH notifications for iOS.

Consider using mod_push which implements XEP-0357 and works with many PUSH services.

This module has nothing to do with XEP-0357 so far.

The main goal of this module is to send all offline messages to the registered (see Usage) clients via APNS.

Donate

Compilation:

Because of the dependencies such as xml.hrl, logger.hrl, etc it's recommended to compile the module with ejabberd itself: put it in the ejabberd/src directory and run the default compiler.

Configuration:

To let the module work fine with Apple Push Notification Service APIs, put these lines in the modules section:

mod_apns:
  address: "gateway.push.apple.com"
  port: 2195
  certfile: "cert.pem"
  keyfile: "key.pem"

You can use a password field in case if you have a password-protected certificate.

Usage (Client to server):

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>

The key will be kept in mnesia database and completely belongs to the JabberID which it was sent from.

What it sends to APNS:

{
  "aps":
    {
      "alert": "Hello!",
      "sound": "default"
    }, 
  "source": "[email protected]",
  "destination":"[email protected]"
}

Compatibility:

The module works fine with Ejabberd 16 up to 16.09.

For the older ones, checkout the ejabberd14 branch.

About

An ejabberd module to send PUSH messages to iOS devices through APNS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Erlang 100.0%