开发者

Request Dialog checkbox option "don't ask before sending..."

I've seen in The Sims Social app a checkbox option on the request di开发者_运维百科alog that says: "don't ask before sending The Sims Social requests to <USER>."

I haven't found this feature on the Facebook API Docs, and I ´d like to know how to enable it on my app.


Flavia

Refer to http://developers.facebook.com/docs/plugins/registration/#custom_fields You should be able to specify any custom fields you wish to include.

{"name":"the-name", "description": "the-description", "type": "option-type"} 

or if options.

{"name":"the-name", "description": "the-description", "type": "option-type", "options": {"name":"value","name":"value"}}

<fb:registration redirect-uri="https://developers.facebook.com/tools/echo" 
 fields='[
   {"name":"name"},
   {"name":"foo","description":"Type foo","type":"text"},
   {"name":"bar","description":"Type bar","type":"text"},
   {"name":"facebooker","description":"Pick Paul","type":"select","options": {"coder":"Paul","pm":"Austin","partners":"Cat"}}]' 
 onvalidate="validate"></fb:registration> 


This functionality is most likely a flag they use internally to know whether the user would like to receive app-generated requests, not a Facebook-implemented piece of functionality. For more information on app-generated requests, try here: http://developers.facebook.com/docs/channels/#requests


set frictionlessRequests as true will do that.

FB.init({
        appId  : 'YOUR_APP_ID',
        status : true,
        cookie : true,
        frictionlessRequests : true,
        oauth: true
      });


you might be shocked, but adding

layout: "iframe"

To th FB.ui request as param should solve your problem. The FB dialog will appear with the checkbox you want.

       FB.ui(
                {
                    method:  "apprequests", 
                    filters: ["app_non_users"],
                    layout:  "iframe",                   
                    data:    "invite",
                    title:   heading,
                    message: text,
                    picture: pictureUrl,
                    caption: text
                },
                function(response) {
                  if (response && response.request_ids) {
                    // the user has successfuly carried out the action
                    fbHandleResponse(response);
                  } else {
                    // user cancelled the action
                    fbHandleFailure();
                  }
                }
            );

Cheers! Jakub

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜