简体   繁体   中英

Facebook IOS SDK Frictionless Requests

There appears to be no way of setting frictionless requests as on for facebook ios sdk. For Javascript inplementations this can be done in the fb.init method.

The only other reference to my problem is Facebook Requests Dialog: Frictionless Requests in native iOS app possible? where it states that frictionless just works when not in sandbox mode.

Has anyone else found this to be the case?

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

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.

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM