Facebook邀请

时间:2014-07-02 05:52:54

标签: android facebook facebook-android-sdk facebook-invite

我使用以下代码邀请Facebook好友加入我的应用

private void sendRequestDialog() {
        Bundle params = new Bundle();
        params.putString("message", "Receipt of Defeat");
        Session session = Session.getActiveSession();

        if (session == null) {
            // try to restore from cache
            session = Session.openActiveSessionFromCache(HomePage.this);
        }
        WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(
                HomePage.this, session, params)).setOnCompleteListener(
                new OnCompleteListener() {

                    @Override
                    public void onComplete(Bundle values,
                            FacebookException error) {
                        if (error != null) {
                            if (error instanceof FacebookOperationCanceledException) {
                                Toast.makeText(
                                        getApplicationContext()
                                                .getApplicationContext(),
                                        "Request cancelled", Toast.LENGTH_SHORT)
                                        .show();
                            } else {
                                Toast.makeText(
                                        getApplicationContext()
                                                .getApplicationContext(),
                                        "Network Error", Toast.LENGTH_SHORT)
                                        .show();
                            }
                        } else {
                            final String requestId = values
                                    .getString("request");
                            if (requestId != null) {
                                Toast.makeText(
                                        getApplicationContext()
                                                .getApplicationContext(),
                                        "Request sent", Toast.LENGTH_SHORT)
                                        .show();
                            } else {
                                Toast.makeText(
                                        getApplicationContext()
                                                .getApplicationContext(),
                                        "Request cancelled", Toast.LENGTH_SHORT)
                                        .show();
                            }
                        }
                    }

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

点击该通知后,它不会移动到Playstore。我想把它移到playstore(我的应用程序)我已经在" Secure Canvas URL"

中提供了链接

2 个答案:

答案 0 :(得分:0)

enter image description here

 Steps:
    1) https://developers.facebook.com/
    2) Select your app
    3) Select Settings from left side panel (Do changes in Basic Tab)
    4) and apply changes according to image 

答案 1 :(得分:0)

我刚开启" Deep Linking"在开发人员设置中,它工作。谢谢你的时间