I have installed GCM in iOS app and everything works fine in Development, I was abel to get push notification. But when I published it to the app store no push notification are coming to the device (works fine in Android).
I installed PersistentConnectionLogging.mobileconfig
file on my iOS device to see the logs and here is what I saw:
Received incoming push notification for topic: com.bundle.id but for a completely unknown token XYZ
here are the exact output messages
Jun 24 11:45:35 iPhone apsd[103] <Notice>: 2016-06-24 11:45:35 -0700 apsd[103]: Received incoming push notification for topic: com.bundle.id but for a completely unknown token <95af08c3 c74a13bf 6b6fb270 c486f2b3 58989f44 dfe69bc0f 95u410e1 2431b8dc>
Jun 24 11:45:35 iPhone apsd[103] <Notice>: 2016-06-24 11:45:35 -0700 apsd[103]: <APSCourier: 0x137d035e0>: Responding with REMOVED status for message received with topic: 'com.bundle.id' to device token (instead of per-app token)
Any idea why this is happening? Why is the token "unknown"? To whom does it belong then?
Have you tried testing your push certification? Houston on GitHub is often used for certificate testing. Basically if the pushes don't work with the third party then you'll need to re-create your certificates.
Using Houston in Cli:
apn push "<5e8f5cc0 be283f88 cc4ebb7d b6091499 80f51631 5ebf4928 b59a2a62 198d20d0>" -c -out "apple_push_notification.pem" -m "Hello from the command line!"
*Houston says, * We recommend that you upload development cert, production, and any ad-hoc certs. Layer will automatically determine which cert to use.
Other potential causes:
Are you correctly calling [layerClient updateRemoteNotificationDeviceToken...]
?
Are you calling inside didRegisterForRemoteNotificationsWithDeviceToken
to send Layer the device token?
You can also check to see if the app is failing to register by implementing didFailToRegisterForRemoteNotificationsWithError
. If you look at the error you should be able to figure out why you're not seeing pushes.
Example Obj-C error check:
- (void) application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
NSLog(@"PUSH ERROR: %@", error);
}
Example Swift error check:
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError!) {
print("PUSH ERROR: \(error)")
}
Potential Xcode/Certificate problem causes:
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