如果用戶已啟用推送通知,請在iPhone上確定我正在尋找一種方法來確定用戶是否通過設置啟用或禁用了我的應用程序的推送通知。
3 回答

縹緲止盈
TA貢獻2041條經驗 獲得超4個贊
iOS8 +(目標C)
#import <UserNotifications/UserNotifications.h>[[UNUserNotificationCenter currentNotificationCenter]getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { switch (settings.authorizationStatus) { case UNAuthorizationStatusNotDetermined:{ break; } case UNAuthorizationStatusDenied:{ break; } case UNAuthorizationStatusAuthorized:{ break; } default: break; }}];
- 3 回答
- 0 關注
- 594 瀏覽
添加回答
舉報
0/150
提交
取消