OGeek|极客世界-中国程序员成长平台

标题: iOS - 设置页面如何仅删除通知 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 10:52
标题: iOS - 设置页面如何仅删除通知

我有一个使用以下代码生成的 IOS 设置屏幕(在 ios 8.0 上):

[[UIApplication sharedApplication] registerUserNotificationSettings:
        [UIUserNotificationSettings settingsForTypes:
        (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) 
        categories:nil]];



[[UIApplication sharedApplication] registerForRemoteNotifications];

结果看起来像这样:

enter image description here

我的目标是仅删除通知区域,但我希望保留隐私和“使用蜂窝数据”。

在模拟器上没有隐私和“使用蜂窝数据”出现。这整个问题是因为我在模拟器上吗?



Best Answer-推荐答案


如果您使用“registerForRemoteNotifications”,此设置将自动存在且不能省略。如果要使用通知,则不允许禁用用户通知设置。

关于iOS - 设置页面如何仅删除通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30486167/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4