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 ;
- }