FQL retrieves empty data set but API explorer does not - android

There are some similar questions but I believe this is a problem on its own.
I'm using Facebook SDK for Android to get my friends photos listed on the device, and when I use Graph Explorer I actually get the data I wanted but inside my app I get only ONE result.
I first tried to use this FQL
SELECT pid FROM photo WHERE owner = me();
But then I found that table photo is not indexable (this link), so I tried with table album
I even tried with my own photos using this FQL
SELECT pid FROM photo WHERE owner = me() AND aid IN (SELECT aid FROM album WHERE owner = me())
I have all necessary permissions (user_photos,friends_photos,user_friends)
Also I have tried to add some limit, like 2 or 25 to check if that could be the problem.
But still nothing! :(
Any of you Facebook gurus have any idea what is my problem?
Thanks in advance
Answer // edited
Oh well... It seems that 5 hours of waiting is not enough for Facebook servers to propagate the changes and that by adding those permissions I wrote above I managed to get what I needed.
So answer would be (just for test phase, for the real thing you need to wait for Facebook servers to propagate):
Go to Graph API explorer
Open FQL tab (or if you are using Graph API stay where you are)
Click the drop down menu in the right top corner where it says Applications
Choose your app (it should be Graph API explorer by default)
Click Get Access Token button
You will see that you are missing some privileges indeed
Select what you need
Approve it
Test your app again in you development environment
Voila

Related

Differentiate two friends with the same name from friend's list (Facebook Android)

I am currently working on a project using the Facebook SDK on Android.
I managed to get a user's friend's list with first and last name, id, and profile picture and would like to save their profile picture on the external sd-card to support offline uses of my app.
To do so, I need a unique name for each user's friend, that stay constant between different sessions in order to load the local picture with the appropriate user.
I tried using the field "id", but the values are change each time I refresh the Facebook token. Therefore, I am not able to recover my picture when reloading the app.
If I use first name and last name, and a user have two friends with the first and last name identical, I will have some issues to differentiate them (ex: Jon_Snow.jpg & Jon_Snow.jpg)
How can I get a unique user identification for each friends that stay the same even after refreshing the token?
Thanks for your help.
The edge /me/invitable_friends does not return IDs for the friends, it returns tokens that are re-generated on each request and are only meant to be used to invite friends to the app using the designated APIs.
To sum it up, what you are trying to do with this endpoint is not possible, also using /me/friends is not possible as it will only return a list of friends that already use your app.
Also, just on a side note, the edge is reserved for Games and not for use by non-game apps.

How to get an access token from Facebook to use in my Android app?

I'm currently working on an android application that has an activity which is showing the timeline photos of a public Facebook page.
I'm using the manual token from the graph api explorer, however, now that my testing is done id like to replace it with one that does not expire after 2 hours OR find some way to refresh the old one every time it expires (I was thinking doing it whenever the old one gets 400'd).
The current URL I'm using to get the timeline photo album JSON is this:
https://graph.facebook.com/v2.2/xxxxxxxxxxx/photos?access_token= + MY_MANUAL_GRAPH_API_TOKEN
I need this token to get the JSON from the public timeline album (for the image urls), nothing else. I do not want anyone to log in or anything like that.
Any ideas? I've looked at the official Facebook Access Tokens documentation and other answers here but I feel like I'm not finding anything that's relevant to what I'm looking for.

how to get/fetch our facebook group list (android sdk)

I integrate my android app with facebook. I want to fetch (then display) list of my facebook group on my app. Maybe anyone have a tutorial to do that?
What you are looking for is the following end point
/me/groups
Which displays the list of the groups the User has subscribed to. But to get the data from the end point you will be required to obtain the user_groups permission to read the User's group.
You can see the documentation at:
https://developers.facebook.com/docs/reference/api/group/

How to display facebook Online friends in my android application?

I want to display my facebook online friends and offline friends suppurate.But i don't know how to display.But I am getting all my facebook friends into list in my application.
Any one please help me.....How to display online and offline friends suppurate.
First - use the fb api. get the friends.
Second - show the list in beautiful Ui component or what ever.
So I understand that you have done the first, right?
If so, then what stops you to make some container and push back dynamically to it labels for example. After this you can try some more beautiful solution how I sad..
try explain more what you've done... Be more specific, please. :)
EDIT 1
Here you are: https://developers.facebook.com/docs/reference/fql/user
Use that:
online_presence
The user's Facebook Chat status. Returns a string, one of active,
idle, offline, or error (when Facebook can't determine presence
information on the server side). The query does not return the user's
Facebook Chat status when that information is restricted for privacy
reasons
EDIT 2
May be you need a loop all your friends and for each of them execute the query
SELECT online_presence FROM user WHERE username = the_friend_from_list
This is a pseudocode but I'm sure you can handle it. :)

Phantom Contact Account Appearing - Android

I am writing an app that allows the user to select from a list of names and then add one of the names (with phone number, etc) to their contacts. When I retrieve my phone's list of Contact Accounts, I am getting 3 results: "Phone", "a000000229aa3e....", "Gmail".
The center result, "a000000229aa3e...." is not an account that I have setup or appears anywhere else on my phone. This also does not appear in the emulator.
My coworker ran it on hit Droid (original Droid) and did not get the odd account. I am running it on a Droid X.
Does anyone know where this Contact Group is coming from? Is there something I need to do to filter this out?
I was able to get the name and type for the odd contact account:
Account Name: a00000229aa3e5-8877431712057062230#random.svcmot.com
Account Type: com.motorola.blur.service.bsutils.MOTHER_USER_CREDS_TYPE
From what I could gather, MOTHER_USER_CREDS_TYPE indicates some sort of Motorola/Provider created account... I ended up filtering this out with !(mAccounts.get(i).getType().toString().contains("MOTHER_USER_CREDS_TYPE")) - I don't know if this will hold up across all devices but it fixed my problem, for the moment.
I don't know all that much about Android apps, but is your phone made by Motorola? or was your previous phone made by Motorola and you copied settings across?
If so it could be a default account, can you see this account when not using your application?

Categories

Resources