问题
I want to forward my users to the Flickr app -if they have it of course- and if they don't to Flickr mobile. I want to make sure that they will see my page. I can do this with Facebook and Twitter by a link like twitter://... However, I don't know the link style of Flickr. Can someone help me. Thanks you!
回答1:
What you're thinking of is called a URL-Scheme. I trying to look up the info, but I think that the developers at Flickr didn't think this through. An example post of my search is right here.
It seems that Flickr only has the flickr://
scheme, which opens the app, but not more than that. It's a shame.
回答2:
The new version has flickr://photos/username/photoID
. You can either use the username or nsid. Both work.
回答3:
Currently, the way to solve this is to open the web URL. The website will redirect you to the app if it's installed.
More on this here: https://www.flickr.com/services/api/misc.urls.html
Example in Objective-C:
//Photo owner id/photo id
NSString *flickrUrlString = @"https://www.flickr.com/photos/12037949754@N01/155761353";
NSURL *flickrUrl = [[NSURL alloc] initWithString: flickrUrlString];
if ([[UIApplication sharedApplication] canOpenURL:flickrUrl]) {
[[UIApplication sharedApplication] openURL:flickrUrl];
} else {
NSLog(@"Unable to open url: %@", flickrUrl);
}
来源:https://stackoverflow.com/questions/18576285/open-flickr-from-third-party-ios-app