androidfacebookfacebook-android-sdkfacebook-invite

Facebook Invitation


I used the following code to invite facebook friends to my app,

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();
    }

On clicking that notification it is not moved to playstore. I want to move that to playstore (My App) I had give the link in "Secure Canvas URL"


Solution

  • I just turned on "Deep Linking" in developer settings and it worked. Thanks for your time