标签:
以启动Instagram为例
Opening instagram://, followed by one of the following parameters, will open our app and perform a custom action. For example, for camera, you would direct users on the iPhone to the custom URL instagram://camera.
URL | OPENS |
---|---|
app | The Instagram app |
camera | The camera (or photo library on non-camera devices) |
media?id=MEDIA_ID | Media with this ID |
user?username=USERNAME | User with this username |
location?id=LOCATION_ID | Location feed for this location ID |
tag?name=TAG | Tag feed for this tag |
The Objective-C call to open one of these URLs is as follows:
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { [[UIApplication sharedApplication] openURL:instagramURL]; }
//开启浏览器打开某网页 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://instagram.com/"]];</span>
https://instagram.com/developer/mobile-sharing/iphone-hooks/#
标签:
原文地址:http://blog.csdn.net/tanmengwen/article/details/44994125