Apple Push Notification not working with ad-hoc build

丶灬走出姿态 提交于 2019-12-09 11:22:38

问题


In development mode I can send push notification to devices, instead I can't in production, my setup is:

  • .pem file that is the combination of aps_production.cer of provisioning portal and the private key of my ad-hoc certificate
  • apple server apn: 'gateway.push.apple.com' with 2196 port
  • I have a rails server that saves tokens from devices and then sends notification to apple with those device tokens and the previous .file for opening connection
  • ad-hoc build applications have (it's rubymotion): entitlements['aps-environment'] = 'production' entitlements['get-task-allow'] = false
  • application when it starts, sends correctly the token to my application server
  • I just checked that the token is different from development mode

The problem is that my rails application sends notifications and didn't receive any errors, but nothing arrived on devices.

I'm using testflight for distribute ad-hoc version of my application, but I don't known any problem using testlight and APNS.

What can be?


EDIT I resolved: the port was wrong, 2195 instead of 2196...


回答1:


APNs have a separate SSL certificate for production and for development.

You are probably using your development certificate with the production build.



来源:https://stackoverflow.com/questions/10900992/apple-push-notification-not-working-with-ad-hoc-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!