0
在iOS的10.3我加入的代碼,到AppDelegate
:點擊本地通知不會被觸發
@interface AppDelegate() {
UNUserNotificationCenter *center;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
center = [UNUserNotificationCenter currentNotificationCenter];
UNAuthorizationOptions options = UNAuthorizationOptionAlert + UNAuthorizationOptionSound;
[center requestAuthorizationWithOptions:options
completionHandler:^(BOOL granted, NSError * _Nullable error) {
if (!granted) {
DLog(@"Something went wrong");
} else {
DLog(@"Access Granted")
}
}];
return YES;
}
我輕按通知,但該方法波紋管不叫。
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification