Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

link to automatically open my App?

Tags:

iphone

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

like image 252
bcb Avatar asked Dec 16 '10 15:12

bcb


People also ask

How do I open an app from a website?

Adding Javascript to Your Website to Open Your App You merely need to add some Javascript to your website that will auto trigger your app open. The function below, triggerAppOpen, will attempt to open your app's URI scheme once you replace your_uri_scheme with the one you added in the manifest above.

How do I bring back always open links of this type in the associated app in Chrome?

What is this? Restart Chrome and the next time Chrome asks for permission to open an external app, the prompt will have the 'Always open links of this type in the associated app' option. Enable this option and Chrome won't ask for permission again next time.


2 Answers

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.

like image 147
Alex Terente Avatar answered Oct 17 '22 00:10

Alex Terente


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.

like image 36
Rod Avatar answered Oct 17 '22 01:10

Rod