OStack程序员社区-中国程序员成长平台

标题: ios - 如何在 ios 中实现 unregisterForRemoteNotifications [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 19:58
标题: ios - 如何在 ios 中实现 unregisterForRemoteNotifications

我想在注销通知时向服务器发送一条消息,但我该如何实现呢?

我写了

[[UIApplication sharedApplication] unregisterForRemoteNotifications];

但是我可以在哪里编写代码发送到服务器



Best Answer-推荐答案


根据docs :

Discussion
You should call this method in rare circumstances only, such as when a new version of the application drops support for remote notifications. Users can temporarily prevent applications from receiving remote notifications through the Notifications section of the Settings application. Applications unregistered through this method can always re-register.

您的服务器没有收到通知,只是当您调用该函数时,向您的服务器发送一个数据包并假设操作成功。

关于ios - 如何在 ios 中实现 unregisterForRemoteNotifications,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9911934/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4