Invite facebook friend not working

I am trying to fetch inevitable friends using sdkbox plugin

void HelloWorld::onInviteFriendsCustomUI(cocos2d::Ref* sender ) {
    
    FBAPIParam params;
    params["limit"] = "100";
    PluginFacebook::requestInvitableFriends(params);
    
    
}

but its giving zero friends

@yinjimmy can help with this.

I’ve the same problem since weeks ago.
friends is empty.

void FacebookHandler::onRequestInvitableFriends(const sdkbox::FBInvitableFriendsInfo& friends)
{
    for(auto it = friends.begin(); it != friends.end(); it++)
    {
        log("%s %s\n", it->getFirstName().c_str(), it->getLastName().c_str());
    }
}

According to the sdkbox tutorial:

The custom invite dialog is only available for games with a canvas implementation for the Facebook application. The canvas must be defined but doesn't need to how any web content. If the canvas is not defined a standard invite dialog is used instead.

I created a Facebook Web App and I completed the canvas URL (with a URL non-existent, 404 error, because I don’t know what url I should complete there because my game isn’t a web game).

However, friends continues returning 0.

I have checked in “Graph API Explorer” Even there it gives only total friend count instead of the friend list.

You will never obtain the total friends info through the api.
Facebook always will returns in the friend list, the friends who played and logged in to your game.

Hi all, Facebook has removed this feature.

https://developers.facebook.com/docs/ios/change-log-4x/

The App Invites feature has been deprecated. (4.28.0 - November 7, 2017)

@yinjimmy I understood that App Invites (default dialog) has been deprecated.
But a custom dialog too is deprecated?

I understood that only sdkbox::PluginFacebook::inviteFriends is deprecated, but not PluginFacebook::requestInvitableFriends

I’m wrong? All is deprecated?

https://developers.facebook.com/docs/graph-api/changelog/breaking-changes/#invitable-friends-4-4

Invitable Friends API
GET operations on the /user/invitable_friends edge will now return an empty data set. The edge will be removed entirely in the near future.

Then How we can implement “Invite friends” in our game.
Is there any other method.

sorry but no idea.

@yinjimmy
But in other big games its still working fine. How?

maybe i need some more research.

may I ask which game ?

You can check in top-10 games in your region.
I checked in this 3 games,
https://play.google.com/store/apps/details?id=com.octro.teenpatti
https://play.google.com/store/apps/details?id=com.ludo.king
https://play.google.com/store/apps/details?id=com.superking.parchisi.star

I tested the ludo game, it requires friend list permission.

But with sdkbox I’m requiring friend list too:

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

However I can’t get friend list using requestInvitableFriends.
In the ludo game, if I log in to facebook and touch “Play with friends” -> “Facebook friends” -> “2P” -> “Invite friends” I can view the default invite dialog, equal to sdkbox::PluginFacebook::inviteFriends when It worked well. Maybe it’s deprecated and for the games that already implemented it, it will stop working soon? Is rare but I think that sdkbox team should investigate it because Facebook Invite feature is very important for the games.

Facebook removed this functionallity, as part of their big security changes

We are also removing the invitable friends API for Facebook web games, which allows an app to invite people who haven’t played the game before.

but it seems only for Facebook web games.

Facebook iOS SDK:

/**
 Convenience method to show a FBSDKAppInviteDialog
 - Parameter viewController: A UIViewController to present the dialog from.
 - Parameter content: The content for the app invite.
 - Parameter delegate: The receiver's delegate.
 - Warning: This method is deprecated.
 */
+ (instancetype)showFromViewController:(UIViewController *)viewController
                           withContent:(FBSDKAppInviteContent *)content
                              delegate:(id<FBSDKAppInviteDialogDelegate>)delegate
__attribute__ ((deprecated("App Invites no longer supported")));


From `FBSDKAppInviteDialog`

/**

 - Warning:use showFromViewController:withContent:delegate: instead
 */
+ (instancetype)showWithContent:(FBSDKAppInviteContent *)content delegate:(id<FBSDKAppInviteDialogDelegate>)delegate
__attribute__ ((deprecated("use showFromViewController:withContent:delegate: instead")));

attribute ((deprecated(“App Invites no longer supported”)));

@yinjimmy thanks for your support. I understand that it’s deprecated but why in other games it works fine?
If I don’t have other alternative, I could replace it with native sharing. But it’s not specially facebook invite.

I think the current game which supports Invite friends, may not have the feature available in the future.
I checked in “Coin master game” which had the invite friend feature in the past, and don’t have it now.
They replaced it with the “Native share” callback.