简体   繁体   中英

Google Cloud Messaging shows “notRegistered” when using iOS distributed app

I have implemented a GCM service on an iOS app. I use PHP to send GCM at the server. It works perfectly when the app is signed by a development provisioning profile.

That is, when the app registers itself using the GCM Config, it always returns a functioning device token. I can send a notification to the device using the token without any error.

But after I sign the app by distributed provisioning profile and test the app by TestFlight or Ad Hoc Provisioning, I received a "Not Registered" error.

{"multicast_id":8921098464640731057,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}"

How does it happen? Any Solution? I have checked that I enabled APNS in both development and distribution provisioning profile.

I did not enable TLS on my server. Actually my SSL Cert is not ready so I can't test it. Is this the reason?

Are you setting the kGGLInstanceIDAPNSServerTypeSandboxOption to NO when you build your app for Distribution?

Your APNS token is being rejected by APNS server and that's when GCM unregisters the GCM registration token for your app and you start seeing the NotRegistered error.

Here is the documentation for the flag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM