Facebook SDK - Wrong ID while invating friends

与世无争的帅哥 提交于 2019-12-12 04:56:43

问题


I want to send invites to user's facebook friends. For that I use the following code:

String KEY_MESSAGE = "message";

    Bundle params = new Bundle();
    params.putString(KEY_MESSAGE, "Learn how to make your Android apps social");

    WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(context, Session.getActiveSession(), params))
            .setOnCompleteListener(new WebDialog.OnCompleteListener() {

                @Override
                public void onComplete(Bundle values, FacebookException error) {
                    if (error == null) {

                        Log.w(TAG, "Posted successfully. Values: " + values);
                        Toast.makeText(context, "Success", Toast.LENGTH_SHORT).show();

                    } else if (error instanceof FacebookOperationCanceledException) {
                        Log.e(TAG, "Post canceled");
                    } else {
                        Log.e(TAG, "Strange error: " + error);
                        Toast.makeText(context, "Error", Toast.LENGTH_SHORT).show();
                    }
                }

            })
            .build();
    requestsDialog.show();

My app shows request dialog. I select one friend and push "Send" button. Then I find out this friend id via this website. My logs:

Posted successfully. Values: Bundle[{to[0]=<unknown-friend-id>, request=388113714696190}]

Friend that I want to bу invited do not recive any invites. And his id do not equals "unknown-friend-id". Why can it be wrong? I've got no ideas

P.S. "unknow-friend-id" is set of numbers. It is someones id. I decided not to publish it. And don't look throw the comments. They are for priveous version of the question.


回答1:


Thanks @WizKid. As he said:

It doesn't work because your app hasn't a canvas version. For more information you should read this



来源:https://stackoverflow.com/questions/28003124/facebook-sdk-wrong-id-while-invating-friends

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!