- Home /
Open facebook sharing link in the facebook app.
Ok So I have a link like this:
Application.OpenURL(fbURL +
"?app_id=" + appId
+ "&href=" + WWW.EscapeURL(link)
+ "&name=" + WWW.EscapeURL(name)
+ "&caption=" + WWW.EscapeURL(caption)
+ "&description=" + WWW.EscapeURL(description)
+ "&picture=" + WWW.EscapeURL(picture)
+ "&redirect_uri=" + WWW.EscapeURL(redirect));
which allows users to share something on facebook based on those parameters(name,link,caption,etc which are all strings). fbURL is just "http://www.facebook.com/dialog/share", and appId is the Facebook id of my app. Now I want to open this type of link in the Facebook app for android if it is installed on the device, else I want to open this in a browser. I already know how to open it in the default browser but I can't open it in the native facebook app. I've already tryied
Application.OpenURL("fb://"+fbURL +
"?app_id=" + appId
+ "&href=" + WWW.EscapeURL(link)
+ "&name=" + WWW.EscapeURL(name)
+ "&caption=" + WWW.EscapeURL(caption)
+ "&description=" + WWW.EscapeURL(description)
+ "&picture=" + WWW.EscapeURL(picture)
+ "&redirect_uri=" + WWW.EscapeURL(redirect));
Can you help me please? Thanks.
Answer by Guhanesh · Feb 13, 2016 at 06:41 AM
Download and use Use FB Unity SDK from here and
FB.ShareLink(
new Uri("https://developers.facebook.com/"),
"Link Share",
"Look I'm sharing a link",
new Uri("http://i.imgur.com/j4M7vCO.jpg"),
callback: this.HandleResult);
will share in FB app.
Wow. Thanks it worked. I was trying with the fb sdk too, but ins$$anonymous$$d of FB.ShareLink I was using FB.FeedShare which was full of errors for me. Anyways do you know how to do this for Google+ and Twitter? Thanks!
I dont think unity plugins are available for Google+ and Twitter.But I use native android share feature to share with other social sites .You can find it here