Reputation: 450
How do we identify if app is launched via app banners?
When app banner is tapped it calls delegate method -
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool
But there can be other instances when this method could be invoked. How can we be 100% sure if app banner is tapped and nothing else?
Upvotes: 0
Views: 361
Reputation: 2018
You can provide context to the app banner via its app-argument parameter. See the official documentation.
For example:
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myscheme://settings">
The URL you would receive in - application:openURL:sourceApplication:annotation:
is myscheme://settings
.
Upvotes: 1