my invite request does not shown to target friend

360 views Asked by At

first of all, sorry to my poor english. I m try to integrate with facebook and my game on android. but i have met a problem. i have sent a invite request to my friend. and response is ok. but it seems like not actually working. target friend can't see the invite request. It's same Whether app is sandbox mode or not.

my code is below :

private static void doRequestInvite() {
Bundle params = new Bundle();
params.putString("message", "Let's play together");

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

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

                if( toastFeedback) {
                    if (error != null) {
                        if (error instanceof FacebookOperationCanceledException) {
                            Toast.makeText( activity.getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText( activity.getApplicationContext(), "Network Error", Toast.LENGTH_SHORT).show();
                        }
                    } else {
                        final String requestId = values.getString("request");
                        if (requestId != null) {
                            Toast.makeText( activity.getApplicationContext(), "OK to invite", Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText( activity.getApplicationContext(), "Request cancelled", Toast.LENGTH_SHORT).show();
                        }
                    }
                }
            }
        })
        .build();
requestsDialog.show();      
}


public static void requestInvite() {
...  
// this is not main UI thread. but web dialog must be run on main UI thread
activity.runOnUiThread(new Runnable() {
    @Override
    public void run() {
        doRequestInvite();
    }
});
}

what can i do for check this? please give some hint.

1

There are 1 answers

1
Christopher Francisco On

If anyone happens to read this thread, I think the problem is that apparently you need to have a Canvas Page in order for the notifications to appear. Otherwise they will only be shown on AppCenter in the Request tab.

However, even if you set up a Canvas Page, I'm not sure how to modify the message of the notification.