Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Unable to use facebookgetfriends() in agk

Author
Message
ry6nso
7
Years of Service
User Offline
Joined: 23rd Feb 2017
Location:
Posted: 28th Mar 2017 18:06
I have two facebook accounts installed my app and both accounts are mutual friend. I can have my facebook accounts logged in the app and the facebook id and name could be retrieved and showed in the app perfectly. (both have permission to share the user list)

Once I use FacebookGetFriends() and FacebookGetFriendsState() , FacebookGetFriendsState() will return -1 (error) even GetFacebookLoggedIn() returns 1.

Anyone can helps. Thanks a lot


My code is as follows:-
function ConnectFacebook ()
FacebookSetup("[my app id]")
FacebookLogin()
repeat
if GetFacebookLoggedIn() = 1
if FBuser<>1
FacebookGetFriends()
facebookid=FacebookGetUserID()
facebookname=FacebookGetUserName()
FBuser=1
endif
if FacebookGetFriendsState() =1
fbfriendscount=FacebookGetFriendsCount()
fbfriends.length=fbfriendscount
for i=0 to fbfriendscount
fbfriends[i].id = FacebookGetFriendsID (i)
fbfriends[i].name = FacebookGetFriendsName (i)
next i
FBconnect=1
endif
endif
until FBconnect= 1
endfunction
ry6nso
7
Years of Service
User Offline
Joined: 23rd Feb 2017
Location:
Posted: 30th Mar 2017 01:49
can anyone have same experience? please help.... thanks
ry6nso
7
Years of Service
User Offline
Joined: 23rd Feb 2017
Location:
Posted: 30th Mar 2017 14:17
I have juz used same code as the developer suggested, but still give -1 when execute facebookgetfriends()

the code is as follows:-

FacebookSetup("my app id")

FacebookLogin()
while GetFacebookLoggedIn() = 0
Print("Logging In...")
Sync()
endwhile

if GetFacebookLoggedIn() = 1
FacebookGetFriends()
while FacebookGetFriendsState() = 0
Print("Getting Friends")
Sync()
endwhile
endif

do
Print("Logged In: " + str(GetFacebookLoggedIn()))
Print("Name: " + FacebookGetUserName() )
Print("Got Friends: " + str(FacebookGetFriendsState()))
Print("Friend Count: " + str(FacebookGetFriendsCount()))
Sync()
loop
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Apr 2017 17:12
Thanks, fixed for the next version.
ry6nso
7
Years of Service
User Offline
Joined: 23rd Feb 2017
Location:
Posted: 4th Apr 2017 15:23
thanks for fixing it

Login to post a reply

Server time is: 2024-11-24 16:39:11
Your offset time is: 2024-11-24 16:39:11