简体   繁体   English

ios unregisterForRemoteNotifications不起作用

[英]ios unregisterForRemoteNotifications does not work

I am trying to get my device unregistered from the remote notification services in my app, so I tried to use [[UIApplication sharedApplication] unregisterForRemoteNotifications] . 我试图从我的应用程序的远程通知服务中取消注册我的设备,所以我尝试使用[[UIApplication sharedApplication] unregisterForRemoteNotifications] But this does not work. 但这是行不通的。 My app still shows up on the notifications section of my iPhone's settings app. 我的应用仍显示在iPhone的settings应用的notifications部分。 Is there any other way I can do this? 我还有其他方法可以做到吗?

It is still there but it won't receive any notifications. 它仍然存在,但不会收到任何通知。 That is the default behavior, once you registered your app will remain in the notification center and it will be activated/ deactivated when you register/unregister for remote notifications. 这是默认行为,注册后,您的应用程序将保留在通知中心,当您注册/注销远程通知时,该应用程序将被激活/停用。

Unregister function is not related to iOS app setting. 取消注册功能与iOS应用设置无关。

Only if you turn on the setting and register notification by function, you can get the notification successfully. 只有打开设置并按功能注册通知,您才能成功获取通知。

If even one of them is off, you should not receive any notification. 即使其中之一关闭,您也不会收到任何通知。

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

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