經常使用Safari瀏覽器瀏覽網頁點擊url會喚醒該網站的手機版app
需要在app的工程中設置
1、打開工程中的myapp-Info.plist文件
2、打開文件中新增URL TYPES的一項,具體如下圖所示:
3、在工程中實現如下方法
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
if (url) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"你喚醒了您的應用" delegate:self cancelButtonTitle:@"確定" otherButtonTitles:nil, nil];
[alertView show];
}
return YES;
}
4、在Safari瀏覽器輸入myapp:// ,就可以啓動應用了,在Safari瀏覽器測試通過