Facebook IOS SDK Frictionless Requests

别等时光非礼了梦想. 提交于 2019-11-29 18:02:24

This call enables frictionless requests:

[facebook enableFrictionlessRequests];

But it is not enough to prevent all dialogs from appearing briefly. Since the frictionless recipient cache is by default not loaded until the first dialog appears. Once the first dialog appears, the frictionless recipient list will be loaded and subsequent dialogs won't appear. However, you can call

[facebook reloadFrictionlessRecipientCache]; 

after a successful login to have the frictionless recipient cache ready before the first dialog appears.

Franco

David Morrison

Frictionless requests can be turned on by setting the "frictionless" parameter of the apprequests dialog to "1". For example;

// create a dictionary for our dialog's parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity: 7];

// set the frictionless requests parameter to "1"
[params setObject: @"1" forKey:@"frictionless"];

// ... add other parameters ...

// show the request dialog
[facebook dialog:@"apprequests" andParams:params andDelegate: nil];

I think this also answers Frictionless Requests on iOS - how?

In newer version (2/25/2012 and newer) of the facebook-ios-sdk, there is a new FBFrictionlessRequestSettings which you can enable once, and then all future apprequests will automatically be frictionless. So when your app starts, you should do:

[facebook enableFrictionlessRequests];

I prefer this over manually setting the @"frictionless" key to 1 because when you send an apprequest, you will still briefly see the FBDialog pop up and then disappear. If you do 'enableFrictionlessRequests', Facebook.m will automatically set the 'isViewInvisible' param for you and prevent the FBDialog from flashing.

Now with the Facebook iOS SDK 3.2.1, you can use frictionless requests without using the deprecated headers. Please check out the BooleanOGSample for implementation detials.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!