gpt4 book ai didi

ios - 注销时注销远程通知

转载 作者:搜寻专家 更新时间:2023-10-31 08:22:32 24 4
gpt4 key购买 nike

关于unregisterForRemoteNotifications

来自apple doc

You should call this method in rare circumstances only, such as when a new version of the app removes support for all types of remote notifications. Users can temporarily prevent apps from receiving remote notifications through the Notifications section of the Settings app. Apps unregistered through this method can always re-register.

有人说:

Calling it would at times put the app in a state where calling registerForRemoteNotifications would no longer work.

为什么 apple 告诉我们只在极少数情况下 使用它,并给出了一个极端的例子,如果新版本的应用程序完全删除了推送通知支持。它不适合注销按钮操作吗?

在我们的应用程序中,用户可以使用多个设备登录。如果 unregisterForRemoteNotifications 运行良好,就会容易得多。有人在注销按钮上使用 unregisterForRemoteNotifications 吗?

最佳答案

是的,您可以在注销时使用unregisterForRemoteNotifications

此函数用于注销Apple Store的所有通知。

您始终可以使用 registerForRemoteNotifications 重新注册通知并开始接收推送通知。并且您可能需要在成功登录时执行此操作。

如果你仔细阅读 Apple Doc 中的那句话,它的最后一行清楚地表明 通过这种方法取消注册的应用程序总是可以重新注册。

他们建议开发人员,如果他们不想在一段时间内收到推送通知,他们可以简单地从设置中禁用。但是对于登录和注销 session ,您可以通过调用 unregisterForRemoteNotifications

并且新版本将停止接收通知意味着在您注销后您将永远不会收到任何通知,直到您重新注册。

关于ios - 注销时注销远程通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39410561/

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