B4A Library Facebook

leitor79

Active Member
Licensed User
Longtime User
Hi,

Nice work, thank you!

Just to be sure before downloading things: with this library, can I get the friends contact list of the logged user? SOAP or XML? (or which format?)

Thank you!
 

leitor79

Active Member
Licensed User
Longtime User
Hi NJDude, thanks fpr your answer.

How can I get my friend's list? I've tried several permissions and fields, but I can only get "me" at best (my ID and my name); I've triend using this:

B4X:
ThePermissions.Add(FB.PERMISSION_READ_FRIENDLISTS)
                ThePermissions.Add(FB.PERMISSION_USER_FRIENDS )
                ThePermissions.Add(FB.PERMISSION_MANAGE_FRIENDLISTS)

Or it's maybe a field issue? I'm using:

B4X:
TheFields.AddAll(Array As String(FB.USER_FIELD_ID, FB.USER_FIELD_NAME, FB.USER_CONNECTION_FRIENDS,FB.USER_CONNECTION_FRIENDLIST) )

Also; there appears to be an encoding issue: the JSONText of the Getfields_Response events returns "\u00ed" instead of "í". Is there a way to specify the encoding?

Thank you very much! Great library!
 

RjCl

Member
Licensed User
Longtime User

I think its only the friends who have actually used your Facebook app that will show
 

leitor79

Active Member
Licensed User
Longtime User
I think its only the friends who have actually used your Facebook app that will show

Hi RjCl! Thanks for your answer!
Yes, the USER_FRIENDS I've read it's about the friends who uses the app. But I need a list of all the friends... or how can I select friends I would like to send a message or invite to use the app?

Add; I also manage to obtain some kind of friend's grups (like "Acquaintances" or "Family") but not the friends on them?

Thank you!
 

Douglas Farias

Expert
Licensed User
Longtime User
HI @NJDude its possible remove the ProgressDialogHide from the results?
for exemple
i dont want ProgressDialogHide when i acess this Sub myFB_GetFields_Response(JSONText As String)
i think you added ProgressDialogHide this on your lib *-*
can remove this pls?

and can give to user chance to change the connection error text ? i m portugues i want to translate this but it is on your lib *-*
 

NJDude

Expert
Licensed User
Longtime User
I'm not really sure but it seems Facebook has changed some permissions, the APIs restricts certain actions to prevent abuse and spamming, maybe that's the case.
 

NJDude

Expert
Licensed User
Longtime User
Removing the ProgressDialogHide can be done, no problem, but the error messages cannot be translated since they come directly from Facebook.
 

leitor79

Active Member
Licensed User
Longtime User
I'm not really sure but it seems Facebook has changed some permissions, the APIs restricts certain actions to prevent abuse and spamming, maybe that's the case.

Thanks NJ!

And what about the encoding issue?

Also; could you post some information about the CustomRequest method? I'm thinking about doing some tests with the friend's list (like using this thing I couldn't find on your library) but I couldn't make it work (nothing happens):

B4X:
FB.CustomRequest("GET","/<a list id>/members","myFB")

then

B4X:
Sub myFB_CustomRequest_Response(JSONText As String)

But this sub is never triggered...

Thank you!
 

NJDude

Expert
Licensed User
Longtime User
@leitor79

To use CustomRequest you need a request ID, your call is almost correct, for example, say you want to get your posts, then you have to do this:
B4X:
fb.CustomRequest("get", "me/feed?", "Custom") 'Custom is the ID of this call, in case you have several.

The result will be shown on the corresponding event:
B4X:
Sub FB_CustomRequest_Response(JSONText As String, ID As String)
Also, as you can see on the top on the screen on THIS link, Facebook has removed that feature, the new API (2.0) doesn't seem to have that either.

Facebook is always changing the APIs, things that work today won't work tomorrow, also, there are many things that APIs cannot do, like I said previously, to prevent spamming, abuse and protect privacy.
 

RjCl

Member
Licensed User
Longtime User

Could this be used for inviting friends ? https://developers.facebook.com/docs/games/invitable-friends/v2.0
 

Douglas Farias

Expert
Licensed User
Longtime User
Removing the ProgressDialogHide can be done, no problem, but the error messages cannot be translated since they come directly from Facebook.
Please let me know when this version available? *-*

and new sugestions

its possible add event

fb.isWebviewvisible = true or false
fb.Xbutton = true or false
fb.webviewvisible = true or false

i want to add when back key pressed
if fb.isWebviewvisible = true then
fb.webviewvisible = false
return
end if

*-*

and X button to close webview optional or user can close using back key or X button

only is a sugestions *-*
 

leitor79

Active Member
Licensed User
Longtime User
Hi NJ, thank you for your answer; I've could manage to do the custom request.

Now I'm having trouble with the PostToTimeline function. I assume it could be used to post on my own wall? I use this way:

FB.PostToTimeline(u,"this is a test",v)

being:
u - my user ID, obtained by the GetFields method
v - a random link.

Also; I don't know how to use (if I can use) the CustomRequest function in order to test a function if I have to send a parameter (to manually post a message using this, look for the "publishing" paragraph)... can it be done?

Thank you very much!
 

NJDude

Expert
Licensed User
Longtime User
Yes, if you use CustomRequest just type the line as it is, for example:
B4X:
fb.CustomRequest("get", "/me/feed?with=location", "Custom")
One way to test and get the right queries is by using the Graph API Explorer, you can just copy the query and create your custom request using the library.
 

NJDude

Expert
Licensed User
Longtime User
Now I'm having trouble with the PostToTimeline function. I assume it could be used to post on my own wall? I use this way:

FB.PostToTimeline(u,"this is a test",v)

being:
u - my user ID, obtained by the GetFields method
v - a random link.
You just need to do this:
B4X:
FB.PostToTimeline("me","this is a test",v)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…