How to detect if the user has the mobile application from a website and open the appHow do I detect a click outside an element?How do I remove a property from a JavaScript object?How do I debug Node.js applications?How do I get a YouTube video thumbnail from the YouTube API?How can I open a URL in Android's web browser from my application?What is the best way to detect a mobile device?How do I remove a particular element from an array in JavaScript?Detecting a mobile browserHow do I return the response from an asynchronous call?What is the list of possible values for navigator.platform as of today?

What does 松の木に吊るされた mean in this sentence?

Exception propagation: When should I catch exceptions?

What is Plautus’s pun about frustum and frustrum?

Does Lawful Interception of 4G / the proposed 5G provide a back door for hackers as well?

Meaning of "sib of 20" in a by-patient case description table

"Right on the tip of my tongue" meaning?

use the oversamplling followed by '' decimation method ''to increasee the ADC resolution and not normal averaging

How can I answer high-school writing prompts without sounding weird and fake?

Who was this character from the Tomb of Annihilation adventure before they became a monster?

Repair a file using Audacity?

How did Thanos not realise this had happened at the end of Endgame?

Why was Endgame Thanos so different than Infinity War Thanos?

Was this character’s old age look CGI or make-up?

How to slow yourself down (for playing nice with others)

Is there any evidence to support the claim that the United States was "suckered into WW1" by Zionists, made by Benjamin Freedman in his 1961 speech?

Word for being out at night during curfew

Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?

What does "Ich wusste, dass aus dir mal was wird" mean?

How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?

Ex-manager wants to stay in touch, I don't want to

What is the best way for a skeleton to impersonate human without using magic?

How do I tell my supervisor that he is choosing poor replacements for me while I am on maternity leave?

How does Howard Stark know this?

Why doesn't Rocket Lab use a solid stage?



How to detect if the user has the mobile application from a website and open the app


How do I detect a click outside an element?How do I remove a property from a JavaScript object?How do I debug Node.js applications?How do I get a YouTube video thumbnail from the YouTube API?How can I open a URL in Android's web browser from my application?What is the best way to detect a mobile device?How do I remove a particular element from an array in JavaScript?Detecting a mobile browserHow do I return the response from an asynchronous call?What is the list of possible values for navigator.platform as of today?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















My website is not mobile responsive, but i have a mobile app for both Android and iOS. When people visit my website using one of these two platforms, I would like to direct them to my mobile app.



If they already have my mobile app, I would like it to auto open that app, otherwise I'd like the person to be redirected to the Google Play store or Apple AppStore to download the mobile app.



I don't know how to do that. Please help me with tips on how to do this.



<?php
class UserInfo{

private static function get_user_agent()
return $_SERVER['HTTP_USER_AGENT'];


public static function get_os() mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);

foreach ($os_array as $regex => $value)
if (preg_match($regex, $user_agent))
$os_platform = $value;


return $os_platform;

?>









share|improve this question
























  • THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

    – Gabe Sechan
    Mar 23 at 12:06

















0















My website is not mobile responsive, but i have a mobile app for both Android and iOS. When people visit my website using one of these two platforms, I would like to direct them to my mobile app.



If they already have my mobile app, I would like it to auto open that app, otherwise I'd like the person to be redirected to the Google Play store or Apple AppStore to download the mobile app.



I don't know how to do that. Please help me with tips on how to do this.



<?php
class UserInfo{

private static function get_user_agent()
return $_SERVER['HTTP_USER_AGENT'];


public static function get_os() mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);

foreach ($os_array as $regex => $value)
if (preg_match($regex, $user_agent))
$os_platform = $value;


return $os_platform;

?>









share|improve this question
























  • THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

    – Gabe Sechan
    Mar 23 at 12:06













0












0








0


1






My website is not mobile responsive, but i have a mobile app for both Android and iOS. When people visit my website using one of these two platforms, I would like to direct them to my mobile app.



If they already have my mobile app, I would like it to auto open that app, otherwise I'd like the person to be redirected to the Google Play store or Apple AppStore to download the mobile app.



I don't know how to do that. Please help me with tips on how to do this.



<?php
class UserInfo{

private static function get_user_agent()
return $_SERVER['HTTP_USER_AGENT'];


public static function get_os() mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);

foreach ($os_array as $regex => $value)
if (preg_match($regex, $user_agent))
$os_platform = $value;


return $os_platform;

?>









share|improve this question
















My website is not mobile responsive, but i have a mobile app for both Android and iOS. When people visit my website using one of these two platforms, I would like to direct them to my mobile app.



If they already have my mobile app, I would like it to auto open that app, otherwise I'd like the person to be redirected to the Google Play store or Apple AppStore to download the mobile app.



I don't know how to do that. Please help me with tips on how to do this.



<?php
class UserInfo{

private static function get_user_agent()
return $_SERVER['HTTP_USER_AGENT'];


public static function get_os() mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);

foreach ($os_array as $regex => $value)
if (preg_match($regex, $user_agent))
$os_platform = $value;


return $os_platform;

?>






javascript php android jquery ios






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 14:56









Mike Hay

2,5591626




2,5591626










asked Mar 23 at 11:34









JeradJerad

829




829












  • THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

    – Gabe Sechan
    Mar 23 at 12:06

















  • THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

    – Gabe Sechan
    Mar 23 at 12:06
















THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

– Gabe Sechan
Mar 23 at 12:06





THere's services out there like branch.io that do this for you. I'd recommend using them, its actually somewhat difficult to do on your own.

– Gabe Sechan
Mar 23 at 12:06












1 Answer
1






active

oldest

votes


















2














On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313309%2fhow-to-detect-if-the-user-has-the-mobile-application-from-a-website-and-open-the%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.






    share|improve this answer



























      2














      On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.






      share|improve this answer

























        2












        2








        2







        On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.






        share|improve this answer













        On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 23 at 11:55









        mymediamymedia

        317119




        317119





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid …


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55313309%2fhow-to-detect-if-the-user-has-the-mobile-application-from-a-website-and-open-the%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?