1.首先在info.plist添加一個鍵值對,如下圖
2.在appdelegate.m文件如下方法寫代碼
-(BOOL)application:(UIApplication*)app openURL:(NSURL*)url options:(NSDictionary<NSString*,id>*)options{
if (url) {
UIAlertView *alertView = [[ UIAlertView alloc] initWithTitle:nil message:@"你喚醒了您的應用" delegate:self cancelButtonTitle:@"確定" otherButtonTitles : nil , nil ];
[alertView show];
}
return YES ;
}