如何查找推送通知是否已启用?

时间:2013-04-04 09:48:04

标签: iphone ios push-notification apple-push-notifications

我想知道用户是否已经启用了脓通知,该怎么做?

我试过这个..

  UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
  if (types ==  UIRemoteNotificationTypeNone){

       NSLog(@"Push is off");

    }

但它不起作用,“类型”总是给出值“7”

1 个答案:

答案 0 :(得分:0)

UIRemoteNotificationType类型:

0 - None
1 - Badge,
2 - Sound,
4 - Alert,
5 - Badge & Alert Only,
6 - Alert & Sound Only,
7 - All Badge,Sound,Alert.
8 - NewsstandContentAvailability.