How to make a Graph API post (Facebook check-in) using Ionic or Angular - facebook

I have successfully added Facebook login functionality to my Ionic 3 application following the Ionic docs and I can receive needed user profile data from Graph API.
Now I can't figure out how to add the check-in option.
Facebook Graph API docs say check-in is now only possible by POSTING the data with the user that has 'publish_actions' rights.
So something like this should work:
this.facebook.api("me/feed?place=123123123123", ["publish_actions"])
(where place is the Place ID of the page I want to check-in)
But it does not work because the api method only creates GET requests and there is no way to set the request method to POST
Also the cordova's Facebook plugin also doesn't seem like it supports posting to Graph API.
I can't find any examples of Ionic check-in code examples or any way of doing this.
Anyone have any experience with this?
I have all the data needed to make this Graph API request - User Id, required permissions and place Id.
Please ask if additional info is required.

Related

Facebook Graph API pull a Posts basic data like Instagram Basic API

We are developing a mobile app that if share a FB post link to it, like you can share on WhatsApp, we want to be able to read the title or summary or start of that FB post, and redirect our App to the corresponding area.
So it works on Instagram using: https://developers.facebook.com/docs/instagram-basic-display-api/
Where give the post ID and it pulls in the caption text etc.
So works for IG and some other socials for anonymous users.
But for FB links, it mostly shows us the login page, in most cases (sometimes it worked on localhost maybe if logged-in - but could not recreate on server environments).
So cannot pull in any info about the post have shared using a direct FB share URL or maybe via some method on FB Graph Api, we could not see an easy way.
Does anyone know a generic method that anyone sharing a post to an app, or even just being able to see the title or summary of a FB post using the default share link, so we can direct our App to the right page.
So essentially using a FB post share link, we want to be able to read some basic data of that Post, whether logged in or not,
and happy to do this via Graph API or FB App or any other ways.
Again in summary - need to Get some user defined parameters or text or ideally hashtags from the post just using the share link of any FB Post/Page.
Any ideas or help appreciated.

Azure Logic apps Facebook connector gives empty response

When I try to use the Facebook connector in Azure logic apps I can't seem to get the "Get user timeline" to work.
I know for a fact that the User ID is valid (I checked using this URL: https://www.facebook.com/profile.php?id=). I also know for sure that the user has posts on it's timeline. I also tried multiple user ID's.
When I open the failed request in the Logic app I get this, the response is empty every time.
Is this related to privacy settings? Why doesn't this work?
We should probably retire/remove that operation. It is not possible to retrieve the post from Facebook graph API for another user's timeline. It used to so that is why it is there. Specifically, this post might be helpful: Facebook Graph API {user-id}/feed from others empty
The connector calls the /{user-id}/feed API. You can try out the behavior in the Facebook Graph explorer as well. https://developers.facebook.com/tools/explorer/

Tag persons in Facebook page post

I've written a Facebook web application, which is able to post links to the app page feed (as the page) by requesting the page token and doing a post request to the /PAGE_ID Graph REST endpoint. So far, so good, but I'd like to tag the links with their authors as well. When I add the tags parameter to this request with a value of my user id (I am an admin of the page), this works fine. But when I enter another user id (even one that likes the app page), no tagging is done. Does anyone have any experience with this? Some blog post suggest this is not possible using the Graph API, even though this is possible when done manually.
Thanks!
If I understand correctly what you want to do, it is no longer possible with the new version of the Facebook's API (v.2.0).
Refer to this page for more informations.

Open Graph insights for specific post

We have a Facebook Application with custom Open Graph objects and actions.
We then use a App Access Token to post stories for a particular user from our backend with the normal Open Graph REST API. After the post-call succeeds we log the returned "id" of that post.
Now we would like to collect insight data (e.g. post_impressions_unique) for some of these individual posts/stories using the logged id's.
According to https://developers.facebook.com/blog/post/573/ we should be able to do something like:
https://graph.facebook.com/[POST ID]/insights
Even though this call seems to work using our normal App Access Token, no insight data is returned for the post/story.
Does anyone know if this is possible and how to do it?
We have been experimenting with a normal User Access Token and the "read_insights" permissions, but with no luck. I have read some similar questions but mainly regarding page-posts (this is an App Open Graph post/story).
EDIT:
The facebook article above only refers to "Page" posts. I'm looking for analytics on individual Facebook App Opengraph Posts/stories. It seems difficult to find any good information about this, has nobody attempted this with any success?
You must add insights into a permissions/Extended permissions
Article :
Getting Page Insights
In order to obtain Page Insights via the Graph API, you must use a Page access token, and you must have the read_insights permission. Click on the link below to see this working in the Graph API Explorer.

How to update facebook profile info from code?

Does someone know the API for updating user profile information on facebook?
I want for instance to change my location from my client application. Is that possible?
I am using Facebook C# SDK, but an example in any other language would be great.
I do not believe they support updating a user's profile information from the exposed Facebook API. The Graph API documentation currently states that only the following elements are editable (editable as in, you can create them):
Wall Posts (feed)
Object Comments
Likes
Notes
links
events
event status
albums
album photos
checkins
As you can see, the User object is not one of objects Facebook exposes for edit purposes. It does support the ability to publish location checkins, however. While this does not meet your goal of modifying the location attribute of a user's profile, it does provide some basic abilities.
POST https://graph.facebook.com/<profile_id>/checkins?
access_token=<access_token>
&coordinates={...}
&message=my+message
&place=<page_id>
&tags=<tag1>,<tag2>,...
See the checkin documentation for an example using curl. This example should be executable by any platform specific Facebook API (Java, C#, etc..).
You can't update informations from the API. All you can do is reading / searching / posting / deleting / analysing data.
You can find everything there.
Cheers