Open mobile app with url - trying to find a single way to open app on IoS Android and Win Phone 8

3.5k views Asked by At

I have an app (myApp) that send a sms/email/... with a link inside. I want to open myApp using this link.

As far as I know (not far), there are different way to open an app from a link. What I am trying to do is open myApp (if installed) using a single link :

for example : http://myapp.com/code/XXX (where XXX is unique and will display special content, like an id.)

I have 3 apps (iPhone, Android and WinPhone) and a web app. By default, web app will do the job. So even if myApp is not installed, this will work in a traditional web browser.

But what if my app is installed ? I want to open it directly, without going throw web browser.

This is well done in Android, where OS ask me how I want to use this link (chrome or MyApp). In Windows Phone and iOS (not tested yet on iOS) this is done via URI scheme. I have something like myapp://XXX. this works also.

So :

  • http://myapp.com/code/XXX will open a browser, except on Android, where I have the choice if myapp is installed.
  • myapp://XXX will open my app on iOS and WinPhone.

I can put JavaScript code on my web app to detect if user is surfing on a iPhone or WinPhone and display a link myapp://XXX which will open myApp (tested and works), but I have no clue if myApp is installed or not, so I need to inform them to download it first, and then click on this link. Not convenient.

How can I do this like on Android ? Open my url http://myapp.com/code/XXX directly to corresponding app on iOS and WinPhone if installed ?

For the moment, my sms looks like this :

"John send you something, click on this link : Web : http://myapp.com/code/XXX App : myapp://XXX "

I Would like to only use one link, which is kind of universal. Is there a best practice ?

1

There are 1 answers

0
Pratik Shah On

There is no other way as if now to make it work except using a webpage URL! As windows mobile and iOS has reserved http:// for their internal use (i.e. for browser launch) So only way is to add a JavaScript logic on the webpage to detect an OS and device and than launch the appropriate URI scheme!

If you don't want to go through all that heavy coding stuff you can use this js plugin for deep linking