Google Cloud Messaging 显示“notRegistered"使用iOS分布式应用程序时 [英] Google Cloud Messaging shows "notRegistered" when using iOS distributed app

查看:36
本文介绍了Google Cloud Messaging 显示“notRegistered"使用iOS分布式应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 iOS 应用上实现了 GCM 服务.我使用 PHP 在服务器上发送 GCM.当应用程序由开发配置文件签名时,它可以完美运行.

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.

也就是说,当应用程序使用 GCM 配置注册自己时,它总是返回一个正常运行的设备令牌.我可以使用令牌向设备发送通知而不会出现任何错误.

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.

但是在我通过分布式配置文件签署应用程序并通过 TestFlight 或 Ad Hoc Provisioning 测试应用程序后,我收到了未注册"错误.

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"}]}"

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

这是怎么发生的?任何解决方案?我已检查是否在开发和分发配置文件中启用了 APNS.

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

我没有在我的服务器上启用 TLS.实际上我的 SSL 证书还没有准备好,所以我无法测试它.是这个原因吗?

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?

推荐答案

在构建用于分发的应用程序时,您是否将 kGGLInstanceIDAPNSServerTypeSandboxOption 设置为 NO?

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

您的 APNS 令牌被 APNS 服务器拒绝,此时 GCM 取消注册您的应用的 GCM 注册令牌,并且您开始看到 NotRegistered 错误.

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.

这是该标志的文档.

这篇关于Google Cloud Messaging 显示“notRegistered"使用iOS分布式应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆