0
votes

I have never come across a worst api documentation than Facebook .

I have been trying to deep link my android application with the facebook , such that when a person presses a story of my app on his facebook , it doesn't launch the browser , rather opens up my app .

I have followed this https://developers.facebook.com/docs/applinks/hosting-api and came across this piece of raw code through which I can generate a deep link .

curl https://graph.facebook.com/app/app_link_hosts \
-F access_token="APP_ACCESS_TOKEN" \
-F name="Android App Link Object Example" \
-F android=' [
    {
      "url" : "sharesample://story/1234",
      "package" : "com.facebook.samples.sharesample",
      "app_name" : "ShareSample",
    },
  ]' \
-F web=' {
    "should_fallback" : false,
  }'

NOW WHAT ? . How should I actually run this request against the facebook server? . I ofcourse can't curl it , from android . Also how should I generate this app access token ?. I actually have so many questions right now .

I would really appreciate if anyone could point me to the correct direction.

1
I definetely agree with you..ken

1 Answers

1
votes
  1. You should run this from your own machine or server, and not in an Android app. The hosting API is not meant for creating thousands of URLs at runtime, it's meant for creating a handful of URLs that you will share and that your app understands. If you need to create or attach custom parameters, just add them to the end of the URL that's created for you, instead of creating new ones.

  2. This is the first result for "facebook app access token" on google: https://developers.facebook.com/docs/facebook-login/access-tokens, there's a section on app tokens. The easiest way to create an app token is to just use app_id|app_secret, so if your app id is 123 and your app secret is def, your app access token is 123|def