0

I am trying to open a native app on my webapp with javascript for ios. It works fine. But if the app not exists, I want to simulate a click to open the link in safari.

I adapt this code from stackoverflow, where element.id is the url I want to open.

setTimeout(function () { 
    window.location = "safari://"+element.id;
}, 5);
window.location = "instagram://"+element.id; 

If instagram doesn't exist, I want to open safari. This is not working. I have the code to open outside my webapp a link in safari but also trying with window.open(element.id); fails. I guess, because I have no more ideas, I have to make a click to that link

Biribu
  • 3,615
  • 13
  • 43
  • 79
  • Did you try the solution suggested in http://stackoverflow.com/a/19637977/1154316 in the setTimeout()-Function? – tillz Jul 16 '14 at 09:24
  • Yes, I tried also and it opens the instagram webpage on my webapp browser so I cannot go back to my pages after whatching the photo. Because of that, I need to launch safari outside my app – Biribu Jul 16 '14 at 09:25

0 Answers0