mrDoctorWho / ejabberd_mod_apns

An ejabberd module to send PUSH messages to iOS devices through APNS
MIT License
33 stars 19 forks source link

Not able to get push notifications in development mode.Though user device token is registered in apns_users in database in ejabbered. #13

Closed pushpender-aggarwal closed 7 years ago

pushpender-aggarwal commented 7 years ago

Hi,

I am not able to get push notifications but i seen ejabberd database and it shows users device token is save in the apns_users. I am using as "gateway.sandbox.push.apple.com" in development mode

mrDoctorWho commented 7 years ago

Hi,

Can you please enable debug logging in ejabberd and show me the logs related to mod_apns?

pushpender-aggarwal commented 7 years ago

There is not any logs in ejabberd.log file.

mrDoctorWho commented 7 years ago

Did you enable debug logging?

pushpender-aggarwal commented 7 years ago

I m getting this 2016-12-28 13:11:32.581 [debug] <0.478.0>@mod_apns:message:83 Offline message

pushpender-aggarwal commented 7 years ago

Module is starting successfully as well 2016-12-28 13:11:04.506 [info] <0.37.0>@mod_apns:start:158 mod_apns Has started successfully!

mrDoctorWho commented 7 years ago

Do your users have subscription both?

pushpender-aggarwal commented 7 years ago

Actually I had modified your case and put otherwise in place of subscription and i am able to go forward but the current is in the following logs

2016-12-29 10:28:53.306 [debug] <0.479.0>@mod_apns:send_payload:35 FORMAT ERROR: "mod_apns: trying to send payload with these parameters: Address: at line:36 ~s Port: ~s Cert: ~s Keyfile: ~s Password ~s" ["gateway.push.apple.com",2195,"cert.pem","key.pem",[]]

2016-12-29 10:28:53.744 [error] <0.479.0>@mod_apns:send_payload:64 mod_apns: Unable to connect to the APNS server: error

mrDoctorWho commented 7 years ago

Can you get a push with your parameters and a different script? To make sure the problem is in my module.

pushpender-aggarwal commented 7 years ago

Actually i tried to send push with the same certificate using python script and i m getting the push on my device. I also tried with http://pushtry.com/ and receiving push as well in my device

Can you tell if there is some configuration that has to be done in ejabbered module to enable ssl??

mrDoctorWho commented 7 years ago

Sorry, I didn't get you. What do you mean by configuration to enable ssl?

pushpender-aggarwal commented 7 years ago

2016-12-29 10:28:53.744 [error] <0.479.0>@mod_apns:send_payload:64 mod_apns: Unable to connect to the APNS server: error

According to above error message we have problem in connection with APNS server and apns uses ssl for the connection. So my is that if there is any module in ejabbered server that has to be enable to connect to ssl.There is also ssl in ejabbered.yml file.Attaching screenshot path.

screen shot 2016-12-29 at 2 03 32 pm

If you have any skyid or something to communicatoin then Please provide me.

mrDoctorWho commented 7 years ago

No, there isn't any configuration that has to be enabled in ejabberd.

You can contact me in jabber: mrdoctorwho@helldev.net (valid ssl certificate required to get through s2s) and hangouts: mrdoctorwho@gmail.com.

mrDoctorWho commented 7 years ago

The problem was in the key and cert paths set in the ejabberd config file. Resolved.