Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open ios app using url?

Tags:

I want to open my ios app using URL schemes. I am able to open app using this. But I want if app is not installed then app store should be opened where user can download app. Is this possible? How can I do that?

EDIT Explaining question step wise:

  1. I have a mail in my inbox with a url.
  2. I click on URL then i. If app is installed in phone, app will launch. ii. Otherwise app store will be opened to download app.

Thank

like image 214
Vivek Sinha Avatar asked Mar 08 '16 11:03

Vivek Sinha


People also ask

How do I open iOS apps?

Swipe left past all your Home Screen pages to see App Library, where your apps are organized by category. To open an app, tap its icon. To return to App Library, swipe up from the bottom edge of the screen (on an iPhone with Face ID) or press the Home button (on an iPhone with a Home button).

Do iOS apps have urls?

Nearly all iOS apps assign themselves one or more URL scheme names. Many also code in various path, parameter, anchor, query, and fragment components for specific requests (sometimes called “deep links”).


1 Answers

I handled it via my server side code:

if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { location.replace("com.myapp://"); setTimeout(function() {                 if (!document.webkitHidden) {                     location.replace("https://itunes.apple.com/app/xxxxxxxx");                 }             }, 25);} else if ((navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/Android/i))) { location.replace("https://play.google.com/store/apps/details?id=packagename&hl=en");} else  { location.replace("http://www.example.com");} 

I put this in my www.mysite.com/download page & share this url via campaigns.

like image 71
Vivek Sinha Avatar answered Sep 28 '22 11:09

Vivek Sinha