简体   繁体   English

推送通知设备令牌

[英]Push Notification Device Token

I have a live app. 我有一个实时应用程序。 in apple store that implements a push notification procedure. 在实现推送通知过程的苹果商店中。 As known I communicate with my server to send and save device tokens. 众所周知,我与服务器通信以发送和保存设备令牌。

My server is receiving device tokens correctly for some devices(Requests) and also receives null values for some other devices. 我的服务器正确接收了某些设备(请求)的设备令牌,并且还接收了某些其他设备的空值。

How is that could be possible in any case?! 在任何情况下怎么可能?

Then you have a bug in your code, the device never generates a null token, or you have failed to implement the following delegate: 然后,您的代码中就有一个错误,设备永远不会生成空令牌,或者您未能实现以下委托:

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err

If this delegate gets called then you could/should implement a retry algorithm that retries to re-register for the APN token a few times. 如果此委托被调用,则您可以/应该实现重试算法,该算法重试几次以重新注册APN令牌。

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

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