Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Open in FB/Twitter/Instagram App vs. Open in Browser

I have an app that is to open the user's Facebook, Twitter, and Instagram feeds in the appropriate app. However, if the person doesn't have that app (i.e. no Facebook app), it should open in an internet browser.

I tried this code...
precode
try
{
window.open('instagram://user?username='+localStorage.getItem("churchIG"), "system");
}
catch(err)
{
window.open("http://www.instagram.com/"+localStorage.getItem('churchIG'), "system");
}
/code/pre

But it's not working. What should I do?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Hello Doug,

We'll look into this as soon as possible and update on the thread.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Hello!

webView doesn't support this url scheme. You would need to search for appropriate PhoneGap plugin.

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Even just to open it in the device's native browser?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Native browser can be opened this way prewindow.open("someUrl", "_system");/pre

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Ok, so I want the app to be able to load the first link when clicked IF the person has that particular app. If they don't, it would open in the native browser. The Try-Catch didn't work above; any thoughts on how to do that?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Open in FB/Twitter/Instagram App vs. Open in Browser

Beautiful! I'll give it a try!

Return to “Issues”