Push notifications works fine in development, but device not getting notification in production

烂漫一生 提交于 2019-12-25 07:15:34

问题


Ok, so I have an app that is in the app store. In development everything works fine I get all of the notifications that I send. I should mention that we are using Firebase for analyics and push notifications as we have a iOS and Android version of the app. Firebase account has both the correct development and correct production apns cert, the app's capabilities are set correctly to include push notifications and remote notifications in the background.

In the organizer window the entitlement for apns-environement is set to production whenever uploading to the app store or when exporting the app. Whenever the app is first installed and ran the alert to allow push notifications is shown. So my apns certs have to be configured correctly. I am a working on contract for this company, just started 3 months ago, I would hate for these people to look at me in a bad light but I really don't know where the issue is. I am also using Xcode's automatic code signing option, with the correct provisioning profile and developer account signed in the Xcode on this mac.


回答1:


Just went through this and I do not know if you solved this,

I turned push off and deleted the certs from apple dev center and created them all over again and this made everything work as it should.

I also had this line of code set to,

FIRInstanceID.instanceID().setAPNSToken(deviceToken as Data, type: FIRInstanceIDAPNSTokenType.sandbox)

I will change it to .prod when I push to the app store.



来源:https://stackoverflow.com/questions/39412519/push-notifications-works-fine-in-development-but-device-not-getting-notificatio

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