2

I'm trying to create a HTML link that shares a text through the Facebook app using URL scheme. This link will be accessed by mobile, Android and iOS.

<a href="fb://publish/?text=http://google.com">Share</a>

When I click this link on my Android phone, the Facebook app opens but does nothing! What is wrong here?

Community
  • 1
  • 1
bodruk
  • 3,242
  • 8
  • 34
  • 52
  • I'd guess Android uses intents instead of URL schemes. – ceejayoz Apr 13 '16 at 13:48
  • 1
    Can I call the Facebook app using a HTML link? – bodruk Apr 13 '16 at 13:48
  • Possible duplicate of [Open Facebook page from Android app?](http://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app) – ceejayoz Apr 13 '16 at 13:51
  • 1
    @ceejayoz No, this is not duplicated! I'm trying to share a link from the browser, not from an app. – bodruk Apr 13 '16 at 13:53
  • 1
    Then you should be using https://developers.facebook.com/docs/sharing/reference/feed-dialog. – ceejayoz Apr 13 '16 at 13:58
  • @ceejayoz So, please remove the "duplicated" annotation. – bodruk Apr 13 '16 at 13:59
  • _“What is wrong here?”_ – what you are trying to do is wrong here. Apps are not allowed to pre-fill the text of a share/post. Go read FB Platform Policy, please. – CBroe Apr 13 '16 at 17:22
  • @CBroe I'm not trying to pre-fill using an app. I'm trying to share a link from a mobile web page running on the browser. – bodruk Apr 14 '16 at 03:40
  • Then you have to use the official methods that pass the link as an extra parameter (no, don’t ask me if that works with those schemes) – if you make it part of the message that is shared, it is pre-filling. – CBroe Apr 14 '16 at 06:37

1 Answers1

2

The Facebook URL Schemes shift a lot, and their functionality is generally not well documented. There was an attempt to catalog them at What are all the custom URL schemes supported by the Facebook iPhone app?

If you can settle for opening the dialog in the browser, you can use the Share Dialog:

https://developers.facebook.com/docs/sharing/reference/share-dialog

Fractaly
  • 834
  • 2
  • 10
  • 25