0

I build a webapp and I have social links in my webapp.

I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.

And incase if I doesnt have any native app installed then it should automatically redirect to browser.

Here it is the code what I have tried:

Javascript:

if(isAndroid){
 fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}

How do I handle this urls...

Please help me out.

user1853128
  • 1,102
  • 7
  • 19
  • 43

2 Answers2

0

This is not possible, for privacy reasons.

See This answer

Community
  • 1
  • 1
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125
0

You can make Hybrid Application.

What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.

So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.

You can do it easily. Start Here: https://developer.android.com/guide/webapps/webview.html

Yashdeep Patel
  • 3,090
  • 1
  • 17
  • 21