I have implemented APNS in my app, and it works during development. After I submit to App Store, the pop-up does not show, which is used to ask users to choose if receive APNS or not. Anyone can give any idea?
I would first check that the binary you submitted had push notifications enabled in the entitlements. In iTunes connect view the details for your app's binary:
You should see the aps-environment
key with "production" as its value.
You can also run the following command in the Terminal to get the information from a .app file on your local machine:
codesign -d --entitlements - MyApp.app
If the aps-environment
key is set to "production", there is probably nothing wrong with your app in terms of the code. It works in the sandbox environment, so it should work in production (since the code is the same for both). This is assuming your release build is running the same code as your debug build.
In your code, you should be handling the application:didFailToRegisterForRemoteNotificationsWithError:
method and NSLogging any errors. This would let you see errors in your device's console.
Since your app is not prompting to enable push notifications, it looks to me like the entitlement is missing. Or push notifications are disabled on the device somehow.
You should also check that your server (provider) is sending the notifications to the production environment (gateway.push.apple.com
), not the sandbox environment (gateway.sandbox.push.apple.com
). Although if this was the problem, the app would still prompt the user to allow push notifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With