关于 unregisterForRemoteNotifications
从apple doc
有人说:
为什么apple
告诉我们仅在的罕见情况下才在中使用它,并给出了一个极端的示例,说明新版本的应用程序是否完全删除了推送通知支持。它不适合注销按钮操作吗?
在我们的应用程序中,用户可以使用多个设备登录。如果unregisterForRemoteNotifications
运作良好,将会容易得多。有人在注销按钮上使用unregisterForRemoteNotifications
吗?
最佳答案
是的,您可以在注销时使用unregisterForRemoteNotifications
。
此功能用于从Apple Store注销所有通知。
您始终可以使用registerForRemoteNotifications
重新注册到通知,并开始接收推送通知。并且您可能需要在成功登录后执行此操作。
如果您从Apple Doc仔细阅读了该句子,则比最后一行清楚地说Apps unregistered through this method can always re-register.
他们建议开发人员是否不想在一段时间内收到推送通知,而不是直接从设置中禁用它们。但是对于登录和注销 session ,您可以通过调用unregisterForRemoteNotifications
来完成操作
并且新版本将停止接收通知,这意味着在您注销后您将永远不会收到任何通知,除非您重新注册。