\Q
为什么我的简单UILocalNotification没有被解雇?
答案 0 :(得分:0)
您是否已将此代码添加到didFinishLaunchingWithOptions
AppDelegate
中
UIUserNotificationType types = (UIUserNotificationType) (UIUserNotificationTypeBadge |
UIUserNotificationTypeSound | UIUserNotificationTypeAlert);
UIUserNotificationSettings *mySettings =
[UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings];
我不确定你是否添加了,但是如果你错过了这个,你就永远不会得到本地和远程通知。
答案 1 :(得分:0)
您必须注册通知设置对于本地和远程通知,请先注册通知设置。