bcb
bcb

Reputation: 939

link to automatically open my App?

1) Is it possible for an iPhone (iOS device) to automatically open an App (that they already have installed) when the user taps on a link (for example a link they received via email)? I'm thinking of using emails for notifications and all the email would have is some text about the notification and then a link that would automatically open the App - it doesn't have to pass any data to the App. If this is possible, sample code (or a URL that explains this) would be much appreciated.

2) In addition, if the user did not have the App, it would be nice if the link could open up the App Store directly to my App so they could download/purchase.

Thanks in advance.

BCB

Upvotes: 18

Views: 25771

Answers (2)

Alex Terente
Alex Terente

Reputation: 12036

Add an URL scheme to your application in the info plist file.

Then catch this in the - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation Read this tutorial about the URL scheme I hope that helps.

Upvotes: 10

Rod
Rod

Reputation: 55752

1) Yes you can do what you described. See the Implementing Custom URL Schemes section in the iOS Application Programming Guide

2) I don't think you can do that. But you could provide a message to the user with another link to the AppStore. Have a look at the Apple URL Scheme Reference.

Upvotes: 6

Related Questions