关于facebook android sdk GameRequestContent调用失败

关于facebook android sdk GameRequestContent调用失败,android,facebook-graph-api,facebook-sdk-4.x,Android,Facebook Graph Api,Facebook Sdk 4.x,使用facebook android sdk 4.8.1 我想使用GameRequestContent API向朋友发送游戏请求 i have a real id for my friend ,then i call GameRequestContent a to send a game request like this GameRequestContent content = new GameRequestContent.Builder().setMessage("Come play

使用facebook android sdk 4.8.1

我想使用GameRequestContent API向朋友发送游戏请求

 i have a real id for my friend ,then i call GameRequestContent a to send a game request

like this

GameRequestContent content = new GameRequestContent.Builder().setMessage("Come play this level with me")
                             .setData("hello")
                             .setRecipients(Arrays.asList("117157035316159"))
                             .setActionType(GameRequestContent.ActionType.SEND)
                             .setObjectId("117157035316159")
                             .build();
                     GameRequestDialog g = new GameRequestDialog(getActivity());
                     g.registerCallback(callbackManager, new FacebookCallback<GameRequestDialog.Result>() {
                         @Override
                         public void onSuccess(GameRequestDialog.Result o) {

                             Log.i("onSuccess", o.toString());
                         }

                         @Override
                         public void onCancel() {
                             Log.i("onSuccess", "onCancel");
                         }

                         @Override
                         public void onError(FacebookException error) {
                             Log.i("onError", error.getMessage());
                             error.printStackTrace();
                         }
                     });
                     g.show(content);
我有一个朋友的真实id,然后我调用GameRequestContent a发送游戏请求
这样地
GameRequestContent=new GameRequestContent.Builder().setMessage(“来和我一起玩这个关卡吧”)
.setData(“你好”)
.setRecipients(Arrays.asList(“117157035316159”))
.setActionType(GameRequestContent.ActionType.SEND)
.setObjectId(“117157035316159”)
.build();
GameRequestDialog g=新建GameRequestDialog(getActivity());
g、 registerCallback(callbackManager,new FacebookCallback(){
@凌驾
成功时公共无效(GameRequestDialog.Result o){
Log.i(“onSuccess”,o.toString());
}
@凌驾
公开作废{
Log.i(“onSuccess”、“onCancel”);
}
@凌驾
public void onError(facebook异常错误){
Log.i(“onError”,error.getMessage());
错误。printStackTrace();
}
});
g、 节目(内容);
我尝试将用户名放入收件人列表失败 但是对我的错误消息响应:{ httpResponseCode:-1,facebookErrorCode:2,facebookErrorType:null,消息:抱歉,此功能现在不可用: 处理此请求时发生错误,请稍后再试(该功能目前不可用,处理请求时出错,请稍后再试)


我希望知道为什么~我能为

做些什么我在中看不到任何名为
setRecipients
的方法。您使用的是哪个版本的sdk?请检查相应的文档。它显示:一组用户ID、用户名或邀请他人发送请求的令牌。您真的将有效的facebook用户ID传递到列表中了吗?您可以尝试一下吗用户名或邀请代币?我必须将facebook用户id放入收件人中,但如何获取有效的facebook用户id?GraphRequest API获取用户id不是真实的facebook用户id,它会加密如果您没有有效的facebook用户id,那么我恐怕这个问题不再在编程范围内。尝试查找其他问题API,它为您提供真实ID,或将图形ID交换为FBID。