常常使用Safari瀏覽器瀏覽網頁點擊url會喚醒該站點的手機版app
須要在app的project中設置
1、打開project中的myapp-Info.plist文件
2、打開文件里新增URL TYPES的一項。詳細例如以下圖所看到的:
3、在project中實現例如以下方法
- (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瀏覽器測試通過