ios8后,发送LocalNotification需要申请权限

scheduleNotification之前,需要申请权限,如下:

[[UIApplication sharedApplication] registerUserNotificationSettings:
        [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert)
                                          categories:nil]];

 

Leave a Reply

Your email address will not be published. Required fields are marked *