USE the facebook-android-sdk 4.8.1
i want use GameRequestContent API send a games request to friend
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);
i has try put user name into recipients aways Failed but !!! a error message response for me : { httpResponseCode: -1, facebookErrorCode: 2, facebookErrorType: null, message: 抱歉,此功能现在不可用: 处理此请求时发生错误,请稍后再试(the function is Not available at now,hava a error when handle the request, please try agin later)
i hope to know why~ how can i do for