Home Ask Login Register

Developers Planet

Your answer is one click away!

Besat February 2016

Error installing mod_apns

I am trying to add mod_apns to ejabberd (15.10) server I've got the module from this link,

These are the steps I followed:

  1. I copied mod_apns.erl file to ejabberd/bin folder

2.From ejabberd module installer I compiled the file :

./erlc -I ejabberd/include mod_apns.erl

3. It produced some warnings:

mod_apns.erl:26: Warning: function hexstr_to_bin/1 is unused
mod_apns.erl:28: Warning: function hexstr_to_bin/2 is unused
mod_apns.erl:127: Warning: variable 'From' is unused
mod_apns.erl:127: Warning: variable 'To' is unused
mod_apns.erl:127: Warning: variable 'Type' is unused
mod_apns.erl:157: Warning: variable 'Opts' is unused
mod_apns.erl:164: Warning: variable 'Host' is unused
  1. I ignored the warnings(?!) and copied .beam file to ejabberd/lib/ejabberd/ebin folder
  2. I copied my cert.pem and key.pem files to ejabberd/conf folder (?!)
  3. I configured ejabberd.yml file as follows:


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

I even tried:

mod_apns: {}
  1. start ejabberd

But the ejabberd won't start and the error file shows this error: Problem starting the module mod_apns for host..

Any help is greatly appreciated..


Besat February 2016

I added these lines of code to mod_apns.erl and it solved the problem of starting module:

-define(LAGER, 1).

right after:

-export([start/2, stop/1, message/3, iq/3]).

I created .beam file and restart ejabberd server. the module is installed and ejabberd server started however, still I don't get any notifications. It should be another question though.

Post Status

Asked in February 2016
Viewed 2,038 times
Voted 11
Answered 1 times


Leave an answer

Quote of the day: live life