经常使用Safari浏览器浏览网页点击url会唤醒该站点的手机版app浏览器
需要在app的project中设置app
一、打开project中的myapp-Info.plist文件post
二、打开文件里新增URL TYPES的一项。详细例如如下图所看到的:url
三、在project中实现例如如下方法spa
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {3d
if (url) {get
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"你唤醒了您的应用" delegate:self cancelButtonTitle:@"肯定" otherButtonTitles:nil, nil];it
[alertView show];io
}class
return YES;
}
四、在Safari浏览器输入myapp:// ,就可以启动应用了,在Safari浏览器測试经过