This is a migrated thread and some comments may be shown as answers.

Launch App from browser

1 Answer 45 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sagi
Top achievements
Rank 1
Sagi asked on 15 May 2016, 07:24 PM
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

1 Answer, 1 is accepted

Sort by
0
Garo
Telerik team
answered on 18 May 2016, 01:47 PM
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.

 
Tags
General Discussion
Asked by
Sagi
Top achievements
Rank 1
Answers by
Garo
Telerik team
Share this question
or