Page 1 of 1

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

Posted: Wed Mar 26, 2014 12:08 am
by Doug Black

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?


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

Posted: Wed Mar 26, 2014 2:05 am
by Alena Prykhodko

Hello Doug,

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


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

Posted: Wed Mar 26, 2014 8:07 am
by Maryna Brodina

Hello!

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


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

Posted: Wed Mar 26, 2014 8:13 am
by Doug Black

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


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

Posted: Wed Mar 26, 2014 8:35 am
by Maryna Brodina

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


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

Posted: Wed Mar 26, 2014 8:51 am
by Doug Black

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?


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

Posted: Wed Mar 26, 2014 10:18 am
by Maryna Brodina

Try PhoneGap plugins, something like this https://github.com/ohh2ahh/AppAvailab...


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

Posted: Wed Mar 26, 2014 11:43 am
by Doug Black

Beautiful! I'll give it a try!