In general, you cannot distinguish this, since links in the App Store can be https: // links.
Link example: https://itunes.apple.com/de/app/myLeetApp/id313370815?mt=8
Apple suggests just using openURL: as you do above. See https://developer.apple.com/library/ios/qa/qa1629/_index.html
If you really want to distinguish them and do something more bizarre (for example, using StoreKit as follows: Is it possible to show "in the App Store modal store" in iOS 6? ), You have no choice but to parse each link with a regular expression So:
import UIKit let url = "https://itunes.apple.com/de/app/myLeetApp/id313370815?mt=8" if url.rangeOfString("itunes.apple.com") != nil { let pattern = "^https?:\\/\\/itunes\\.apple\\.com\\/.*id([0-9]*).*$" if let regex = NSRegularExpression(pattern: pattern, options: .CaseInsensitive, error: nil) { let extractedAppID = regex.stringByReplacingMatchesInString(url, options: nil, range: NSMakeRange(0, countElements(url)), withTemplate: "$1") } }
With extractedAppID you can open SKStoreProductViewController , etc.
stk Mar 15 '15 at 10:23 2015-03-15 10:23
source share