經常使用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瀏覽器測試經過