[SOLVED] SDKBOX Facebook friend list

Hi
How do i get facebook friend list on Android by sdkbox?
I try PluginFacebook::fetchFriends(), and get data from onFetchFriends. But receive nothing.
I also try PluginFacebook::api("/me/friends", “GET”, params, “/me/friends”), but only get something like this {“summary”:{“total_count”:186},“data”:[]}

1 Like

Currently I am using SDKBox for my app’s social feature. Everything was fine including login and granting permissions (. However due to Facebook’s policy, I cannot retrieve friends list from “/me/friends”. I switched to use “/me/invitable_friends” instead (Ref: https://developers.facebook.com/docs/games/invitable-friends/v2.4)

But when I call sdkbox::PluginFacebook::api("/me/invitable_friends", "GET", params, "/me/invitable_friends");, my app crashed with the following log:

2015-09-24 10:17:33.989 GreenDotDot iOS[33042:3259826] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** setObjectForKey: object cannot be nil (key: message)’

But when I call sdkbox::PluginFacebook::api("/me/friends", "GET", params, "/me/friends");
It works fine and reached my callbacks (although no friends data)

Using cocos2dx version cocos2d-x 3.4rc1, sdkbox version v0.5.6.23
Testing my app with iPhone5 iOS 8.3

Please help!! Thank you!

1 Like

Turns out I need to add Facebook canvas in my facebook app. Then I can retrieve invitable friend list from the call.

1 Like

thanks, you solve my problem~~

can you guide me how did you add facebook canvas in facebook app ?

hi @shauket

Please go to the settings tab of your app and then click on Add Platform.
It should be in the bottom.

Please follow the step by step instruction from facebook developers site or google it.

Best,
Pabitra

hi. @pabitrapadhy . i have already add platform as you said. But i still can not get inviteable_friends. Can you guide me detail? thanks so much!

Note you can only get friends that’s flagged as tester or developer when your facebook integration is still in testing stage.

thanks you. i can get it via api