Reputation: 45
My facebook sdk 5.1.0, Unity 4.5.2f1 Platform is iOS.
I want invite my facebook friend to use my app just like "Candy Crush Saga" or "FarmVille 2" can get my all friends ,display them on custom UI and invite them to play app. But I have problem getting friend list and setting custom UI.
using facebook unity example, it can get friends and send invite, but I can't get these info and it can't custom UI;
when facebook login , i get user_friends permission. I can't use invitable_friends to get friend list, but "me?fields=friends" can get friends already use my app.
My login and get invitable_friend code:
FB.Login("email,publish_actions,user_about_me,user_friends,basic_info", LoginCallback);
...
FB.API("me?fields=invitable_friends.limit(10)", Facebook.HttpMethod.GET, InvitableFriendsCallBack);
How do i get friends not play my app then send app invite?
edit: when login on ios, I get error "FBLogin error".
Upvotes: 0
Views: 2603
Reputation: 68
You can't get friends, who doesn't play your game with iOS game. https://developers.facebook.com/docs/games/invitable-friends/v2.2
The invitable_friends API is only available for games that have a Facebook Canvas app implementation using version 2.0 of the Graph API.
You may use FB.AppRequest
to invite friends in game. https://developers.facebook.com/docs/unity/reference/current/FB.AppRequest
Upvotes: 1