質問

I need to pass additional parameter to redirect url when the user accept fb app request or need to redirect user to a custom url. How can I do this?...Please see the following code.

   $('#sendRequest').click(function() {
          FB.ui(
            {
              method  : 'apprequests',
              message : $(this).attr('data-message')

                    },
            function (response) {
              // If response is null the user canceled the dialog
              if (response != null) {
                 logResponse(response);
              }
            }
          );
        });
役に立ちましたか?

解決

I have used "data" parameter to send information while sending the request and accessed it in the other end using the "request id".

 $('#sendRequest').click(function() {


          FB.ui(
            {
              method  : 'apprequests',
              message : $(this).attr('data-message'),
              data: sessionId,
              max_recipients:1

                    },
            function (response) {
              // If response is null the user canceled the dialog
              if (response != null) {
                 logResponse(response);
              }
            }
          );
        });

他のヒント

There is nothing that you can add in the code you’ve shown.

If you need to combine any data with a request, than you’ll have to save this data to your own database, so you can look it up again when receiving the request id(s) send to you when a user accepts requests.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top