Launch App from browser

2 posts, 0 answers
  1. Sagi
    Sagi avatar
    60 posts
    Member since:
    Sep 2008

    Posted 15 May Link to this post

    I'm trying to launch my app in case it is installed and fallback to my website if tbe the app does not exist. (got some insights from  : http://stackoverflow.com/questions/13044805/how-to-check-if-an-app-is-installed-from-a-web-page-on-an-iphone

    I was able to launch the app using custom url scheme , but was only able to so when there is user interaction (e.g. user clicks a button/link) :

         <a onclick="window.open('myapp://foo=bar', '_system')">Launch myapp</a>


    However When using 

      window.open('myapp://foo=bar', '_system');

    or 

     window.location = 'myapp://foo=bar'

    without user interaction (e.g. on window load / document ready) the app does not launch.

    Is this expected ?

    Any workarounds ?

    Thanks
    Sagi
  2. Garo
    Admin
    Garo avatar
    46 posts

    Posted 18 May Link to this post

    Hello Sagi,

    I am afraid the case you are describing cannot be achieved due to browser restrictions. Attempting to invoke window.open without user interaction(click event) will be blocked by the browser for security purposes.

    This being said, I am not aware of any workarounds you can use to reach the desired effect. Please have in mind that even if a workaround exists it will most likely be browser-specific and not a general solution.

    I hope this helps.

    Regards,
    Garo
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top