简体   繁体   English

PubNub在注册频道后没有收到推送通知?

[英]PubNub not receiving push notifications after registering with channel?

I register for push notifications with my device with my device token from APNS. 我使用来自APNS的设备令牌向我的设备注册推送通知。 I've registered on channel A, but never receive notifications. 我已经在频道A上注册,但从未收到过通知。 Is there an easy way to troubleshoot this? 有一个简单的方法来解决这个问题吗?

This is a question we get a lot. 这是一个我们得到很多的问题。 This most often is due to the fact that the device push registration token invalid. 这通常是由于设备推送注册令牌无效。 There are many reasons why a token will become invalid. 令牌失效的原因有很多。 Very often it is due to the user deleting the app from their device. 通常是由于用户从他们的设备中删除了应用程序。 If they reinstall, it will need a new push token. 如果他们重新安装,则需要一个新的推送令牌。

The best practice is to make sure that the token is valid by asking for the token every time the app cold starts - meaning 1didFinishLaunching` is invoked. 最佳做法是通过每次应用程序冷启动时请求令牌来确保令牌有效 - 意味着调用1didFinishLaunching`。 Caching this token on the device and comparing it with each fetch will let you know if the currently registered token has been invalidated. 在设备上缓存此令牌并将其与每次提取进行比较将告知您当前已注册的令牌是否已失效。 For more details on best practices, please read PubNub KB article, Can I prevent my iOS end users having an invalid registration token? 有关最佳做法的更多详细信息,请阅读PubNub知识库文章, 我可以阻止我的iOS最终用户使用无效的注册令牌吗? .

To troubleshoot push notification issues with PubNub (even if they are not PubNub root cause), please review How can I troubleshoot my push notification issues . 要解决PubNub的推送通知问题(即使它们不是PubNub的根本原因),请查看我如何解决推送通知问题 This will layout step by step the process for getting to the root cause of the issue. 这将逐步布局找到问题根本原因的过程。 This also works for PubNub GCM push notification issues. 这也适用于PubNub GCM推送通知问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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