Facebook IOS SDK Frictionless Requests

时光怂恿深爱的人放手 提交于 2019-12-18 09:49:48

问题


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

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