gpt4 book ai didi

iphone - didRegisterForRemoteNotificationsWithDeviceToken - 推送通知

转载 作者:可可西里 更新时间:2023-11-01 05:01:49 32 4
gpt4 key购买 nike

我只是想确认“didRegisterForRemoteNotificationsWithDeviceToken”是指在每次应用程序加载时调用并且我的 PHP 服务器或应用程序需要处理是否重新提交以存储在我的数据库中?还是我缺少什么?

谢谢詹姆斯

最佳答案

首先,您不应该直接调用此方法。相反,您应该在每次启动您的应用时调用 registerForRemoteNotificationTypes:,然后依次调用您必须实现的 application:didRegisterForRemoteNotificationsWithDeviceToken:

其次,是的,您应该每次都将 token 重新提交到您的服务器。来自文档:

By requesting the device token and passing it to the provider every time your application launches, you help to ensure that the provider has the current token for the device. If a user restores a backup to a device other than the one that the backup was created for (for example, the user migrates data to a new device), he or she must launch the application at least once for it to receive notifications again. If the user restores backup data to a new device or reinstalls the operating system, the device token changes. Moreover, never cache a device token and give that to your provider; always get the token from the system whenever you need it. If your application has previously registered, calling registerForRemoteNotificationTypes: results in iOS passing the device token to the delegate immediately without incurring additional overhead.

关于iphone - didRegisterForRemoteNotificationsWithDeviceToken - 推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4804148/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com