1

To open a facebook page in from another app we use intent passing the "fb://page/" uri as an ACTION_VIEW intent.

But what if I want to send an image along side, something like ACTION_SEND but only to facebook app, I realize it would be an implicit intent call, but is there any workaround here.

Note: I want to open Facebook Page Feed NOT the profile account. Earlier facebook allowed to choose whether to post to page or not while making a post but now the mechanism is changed in its app.

Done so far: Open the particular facebook page in fb app

Want: Open that page with the image I share using intent, with EXTRA_STREAM

  • https://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app Please check this may be it will help you Thanks – Avinash tiwari Dec 09 '19 at 06:20
  • @Avinashtiwari yes I had already checked it out and implemented those methods only to open fb page but here I want to open page with image I share using intent. Thanks for help. – Shanover Saiyed Dec 09 '19 at 06:26

2 Answers2

0

You have to use facebook SDK for sharing image from your app to facebook.

Just go through facebook documentation by clicking here

Or go through this link

https://developers.facebook.com/docs/sharing/android

0

There are two ways to do it:

  1. First: To use Facebook SDK for which you have to load their dependency and what not, as mentioned in Avinash Kumar Singh's Answer. There are methods that would help you greatly.

But

I would recommend the second method,

  1. Here you only need to call POST/GET request to Facebook Graph API, https://developers.facebook.com/docs/graph-api/reference/page/. There is some endpoint for almost everything, to publish to profile, delete, comment, or on a page managed by that profile. Only things you need are a) An access token, that can be generated from facebook developer page. b) Proper permission on that access token, like "manage_page", "publish_page" c) The expiry of the token is short-lived you have to extend it, and even so one can extend it to most 2 Months, after that it has to be renewed.

With everything at place, the only thing left is to send get/post requests with proper access token and the data you wish to send or receieve.