Facebook, how to send an application authorization request to friends?

I am creating an application that connects to Facebook. When a user uses my application, I can get a list of my friends and display it. Now I want to add an option so that the user can send a request to his friend to ask them to authorize my application. Here is my code:

Facebook facebook = new Facebook(MY_APP_ID);
Bundle params = new Bundle();
params.putString("to", MY_FRIEND_ID);
params.putString("message", "This is the message text");
facebook.dialog(((Activity) ctx).getParent(), "apprequests",
        params, new DialogListener() {

            public void onComplete(Bundle values) {
                // TODO Auto-generated method stub
                Log.v("invite", "complete");
            }

            public void onFacebookError(FacebookError e) {
                // TODO Auto-generated method stub
                Log.v("invite", "e1");
            }

            public void onError(DialogError e) {
                // TODO Auto-generated method stub
                Log.v("invite", "e2");
            }

            public void onCancel() {
                // TODO Auto-generated method stub
                Log.v("invite", "cancel");
            }

        });

OK this code works and it sends the application request to my friend. But this request will redirect my friend to the application’s canvas page set in the facebook application’s settings. Is there a way to send a request redirecting my friend to a page authorizing my application. I think in facebook.dialog(((Activity) ctx).getParent(), "apprequests", params, new DialogListener() {me I need to replace apprequests with something else. Can anyone help me with this?

EDIT: , . . facebook , . , .

+5

All Articles