Facebook graph api to get recent feed's by other user - android

i want to get particular person public feeds to show in my application.but in response empty data value returning.without login into Facebook i have get the Facebook user public post.
Am getting response: Unsupported get request

That is impossible, you can only get access to the feed (public or not) of someone who authorized your App with the user_posts permission. You could use an Extended User Token that is valid for 60 days to read the feed, but in general you are not supposed to show user feeds on an external website. Better use a Page for that, with an App Token or Extended Page Token - both are valid forever.

Related

How to get all stories from instagram

I am using an old version of instagram for android where I can listen to the SSL requests with Charles Proxy (on PC I did not).
When I get the stories ('feed/reels_tray/') not all users have items.
For that it is necessary to send a POST to 'feed/reels_media/' with all the ids (pks) and this returns the items of all.
But I can not form the post correctly. I always get the message:
"Message": "Invalid user list"...
Any ideas?
Here is instagram api to get feed list from user account
"https://api.instagram.com/v1/users/self/media/recent/?access_token="+USER_ACCESS_TOKEN
It get to post list from user account.

Android Fetching public data of facebook using graph API without any access token

http://graph.facebook.com/v2.8/154810390/ does not fetch public data without access token. return error with code 104 and message "An access token is requir…o request this resource."
Though http://graph.facebook.com/v2.8/154810390/picture fetch public picture.
Passing null to first parameter of GraphRequestObject() in place of access token returns same error.
I just want fetch name and profile picture of users by their ID even if current user is not logged in (dont have access token)
Gone through the docs but have not got any clue. any ideas?

Add metadata to Facebook App invite

While sending out an App invite in my app, I am trying to find a way to add metadata to it so I can track internally who sent invites and how successful they were (Facebook only shows data from when the dialog is opened and there is no way to track specific funnels).
my code for sending the invite is:
private void openFacebookAppInvite() {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(FACEBOOK_APP_LINK_URL)
.setPreviewImageUrl(INVITE_PREVOEW_IMAGE_URL)
.build();
// WANT TO ADD METADATA HERE
AppInviteDialog.show(this, content);
}
Maybe this is not the answer that you had hoped for, but I think it will help to implement your requirements.
Part 1: send data directly with an AppInvite
As far as I know, it is not possible to send custom data with AppInvites created with an AppInviteContent.Builder directly. I will explain a more complex possibility in Part 3. But maybe a GameRequest is an option for you. A GameRequestDialog can be initialized with a GameRequestContent object. The method setData of the class GameRequestContent.Builder "sets optional data which can be used for tracking".
Part 2: tracking invites
Of course you can track that an user opened the AppInviteDialog (by do a simple request to your server). Sadly it is not possible to track which or how many users are invited.
But after an invited user accepts the invitation, installs and run the mobile app (or give you the permissions on a canvas, if you have a canvas app too), you are able to get all AppRequests (Invites) by do a query to /me/apprequests with the Graph API.
Also possible:
Canvas App: The POST request, your server will get after an invited user opens the canvas page, contains a parameter request_ids. This is a comma separated list of app-request-ids, which can be used in a graph query.
Mobile App: After the invited user installed and started the app in response to an AppRequest, you are able to get the app-request-ids from the intent or by the use of AppLinkData.fetchDeferredAppLinkData and appLinkData.getTargetUri().getQueryParameter("request_ids"). See the section "Supporting incoming links" in the documentation. Now you are able to create a graph api request.
Part 3: send data with an AppInvite via an App-Link
As shown in Part 2.2., you will get a targetUrl after an invited user opens the app. This targetUrl is specified in the AppLink found under the AppLinkUrl you used for the AppInvite. With a "Dynamic App Link endpoint" it is possible to send data to the invitees.
Here an idea how to implement this:
Your server defines an endpoint with the uri-template POST:http://example.com/users/${USER}/invites/. ${USER} is the username of the sender of the invitation.
Before creating the invitation dialog, the client sends a POST request to the endpoint from step 1 and will get an UUID as a response, which references the planned invitation and the user.
the server defines a second endpoint GET:http://example.com/users/${USER}/invites/${UUID}. The response to this endpoint is a page with a defined AppLink where al:android:url is example://users/${USER}/invites/${UUID} - of course the placeholder ${USER} and ${UUID} are replaced with the correct values from step 1 and 2.
The client uses the endpoint from step 3 (http://example.com/users/${USER}/invites/${UUID}) as the app-link-url when creating the AppInviteContent.
The invited user accepts the invitation and opens the app. Now we are able to get the UUID from the targetUrl (see step 2.2 / "Supporting incoming links").

ParseUser.getCurrentUser() confusion

I'm using Parse as the backend.
To check if the user is logged in I use ParseUser.getCurrentUser(). What I don't understand is, if the user changes his password from somewhere else (another device, the web-client), will this ParseUser return with some kind of error?
I don't think it does a check on the server, so I think it just returns the last saved user. This mean that I can continue to use this user (with an old password) or will I get a "wrong credential" response on the first request to the servers?
If I don't get it, will I at least get it when setting an ACL with parseObject.setACL(new ParseACL(ParseUser.getCurrentUser()));?
Try same action on yahoo in 2 open browsers of different types and see what you get?
Each client's been handed a token value by the respective servers and until the token expire will not be prompt for a new logon.
Well IMO Parse work very similar except the lease on Parse token never expire.
Response to the original parse logon contain the token value which the SDK may retain. Details are in the docs section on Rest api / user logon...
So, if a diff client change password but the token lease over on some other client never expire, the other client stays logged in.

How to access facebook public newsfeed json/xml without authentication

I was working with twitter APIs and I am able to get specific user's timeline (tweets) without making the end user to login.
How can I do this in facebook? I don't want my user to login to facebook. I just need some feeds from users/pages which are publicly shared.
Does facebook allows this? How to do it? Any links
I don't know about Android but For Facebook API, I managed to get users / pages feed (public only) using the graph for a small project I was working on, this snippet might
help you
<?php
$pageContent = file_get_contents('https://graph.facebook.com/USER_ID/posts?fields=id,name&limit=1&access_token=ACCESS_TOKEN HERE');
// You can use your app token
$parsedJson = json_decode($pageContent); // decode JSON
echo $id = $parsedJson->data[0]->id; // this echos only the latest post ID
?>
So as you see, the code above requests Facebook graph and returns only post (latest one) from the user feed (because I limited it &limit=1) that code is working for me and might works for your needs

Categories

Resources