Sdkbox pluginfacebook inviteFriends don't work

I am developing a game where I integrate facebook plugin via sdkbox. In my game I want to implement facebook invitation but sdkbox::PluginFacebook::inviteFriends( applink, imageurl) is not work. After some research I found that facebook change the API after the cambridge analytica scandal and they depricated the invitable_friends API endpoint as well as facebook native invite dialog. But I found some big games still have the invite friends feature. Example games are
Coin Master
Teen Patti Gold

As they can offer invitation friends then it’s sure that there have a way to invite friends.

Please help me to implement facebook invitation or other alternative will be a plus.

Thanks
Nirob

let’s test these games.

You can use FB API for get the info, and make your own ‘invite friends’.

sdkbox::FBAPIParam params;
params["fields"] = "id,first_name,last_name,picture{url},friends{id,first_name,last_name,picture{url}}";
sdkbox::PluginFacebook::api("me", "GET", params, "me");

Check out Facebook Graph API for customize the parameters. For example, you could create a button for send an email to your friend, for invite to play.

Else, you can use native sharing for iOS and Android (sdkbox offers a plugin for that).

as I tested, you can try:

    std::vector<std::string> vec;
    vec.push_back("");
    PluginFacebook::inviteFriendsWithInviteIds(vec, "Invitation title", "Invitation text up to 60 chars.");

Thanks,

1 Like

Your suggested method only return the owner information not friends information. So it doesn’t work.

Thanks for your reply

Thanks @yinjimmy this one works. You save me a lot. I was trying for 7 days.

Thank you very much

You must login as:

vector<string> permissions;
permissions.push_back(sdkbox::FB_PERM_READ_USER_FRIENDS);
sdkbox::PluginFacebook::login(permissions);

@yinjimmy
Is recommended to use it despite of Facebook said that’s deprecated?

inviteFriends api deprecated, but inviteFriendsWithInviteIds still works. :slight_smile: