jpoz / APNS

An Apple Push Notification Service gem
MIT License
543 stars 195 forks source link

send_notification returning nil with no status of notification #44

Open toshitapandey opened 8 years ago

toshitapandey commented 8 years ago

I'm using following for sending the notification.

APNS.host = 'gateway.push.apple.com' APNS.pem = "#{Rails.root}/doc/pushcert.pem" APNS.port = 2195 APNS.send_notification(token, message)

but all it is returning is nil and notifications are not being sent and all the associated article call APNs a black box with not round about for this. Is there any way to figure out the errors and reasons for notifications not being delivered ?

cwilliamsnh commented 7 years ago

I seem to be having the same issue... Is there any way to debug the APNS.send_notification call?

tfrasc commented 7 years ago

@toshitapandey @cwilliamsnh are you in dev/sandbox or production? In dev/sandbox the APNS.host should be gateway.sandbox.push.apple.com, production should be gateway.push.apple.com. I also had trouble using #{Rails.root}, trying using Rails.root.join('doc/pushcert.pem'), that worked for me.