问题
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?
回答1:
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
回答2:
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?
回答3:
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.
回答4:
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.
来源:https://stackoverflow.com/questions/8447935/facebook-ios-sdk-frictionless-requests