0

I'm working on a basic Xamarin.Forms app for a client, which will contain some tabs like :

  • a company presentation tab (address, phone number, mail, ...)
  • a news tab, with data coming from a dedicated API, or posts from the company's Facebook page
  • a tab allowing to schedule an appointment
  • an "about" page tab

For the news tab, I would like to display informations coming from a dedicated service, or from my client's Facebook page. In both cases, I would like to display a "date", an "image" and a "description". If the data come from Facebook, I would like to display too the "URL" to redirect to the corresponding post.

To recover the Facebook feed of my client's page, I've created a new app on "developers.facebook.com", and I can recover the expected informations ("created_time", "message", "id", "picture") through the API Graph Helper, with calls to "client_page/feed" or "client_page/posts".

For the moment, I'm able to recover the data in my app with an URL like: https://graph.facebook.com/v8.0/client_page/posts?fields=message%2Cmessage_tags%2Cpicture%2Cfull_picture%2Cpermalink_url%2Ccreated_time%2Cstory&access_token=ACCESS_TOKEN

But I have remarked that returned post that are events have not "message" field to display any information about this event. I can recover it by calling "client_page/events", which return some other informations like "id", "start_time" or "description".

  • I can't find a relation between the results of these 2 calls ("client_page/posts" and "client_page/events"): the returned id are not corresponding. Is there a way to find a relation between a "post" and an "event"?

  • Is there another way to recover these information, like an existing package that I could import in my project directly?

  • And finally, I haven't yet found a way to generate a "permanent" token to make these calls: must this be done on my client's page side or on the Facebook app side?

I finally found a way to create a permanent Access Token in this old post.

But with the generated token, I have no longer access to the events:

  • with a call to "client_page/feed" I get the posts but no longer the events
  • with a call to "client_page/events" I get an empty result

Would you have any suggestion?

Gold.strike
  • 1,269
  • 13
  • 47
  • 1
    this sounds like a FB Graph API question. The fact that you're using Xamarin is irreleveant – Jason Sep 15 '20 at 15:08
  • Yes probably, but maybe some Xamarin developers have already meet a similar need, or could tell me if there is a library that can help me. – Gold.strike Sep 15 '20 at 15:10
  • _“the returned id are not corresponding”_ - probably because they are different objects. There is the event itself, and then there is a timeline post about that event. – CBroe Sep 16 '20 at 06:58
  • And regarding token lifetime, https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing – CBroe Sep 16 '20 at 06:58
  • Hi @CBroe, "events" and "posts" are different objects. But when I call the "client_page/posts" the "event" is returned as a "post" with some fields ("id", "creation_date", "picture" but without any text information as "message". If I call the the "client_page/events" I get the same event with the expected informations, like the related text in "description" field. I would like to be able to link these items, to add manually the missing informations like the description. – Gold.strike Sep 16 '20 at 07:05

0 Answers0