Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook SDK 4.2 FBGraphUser protocol update

I am working on an Xcode project that has Facebook SDK 3.1.4. I am currently updating the SDK to 4.2. I was just wondering if someone can help me with the update related to FBGraphUser protocol and how I can update that for Facebook SDK 4.2. I have looked around and found that they have defined it in FBSDKShareKit. I looked at FBSDKShareOpenGraphObject as well but was not able to figure out how to update it. Or should I be using FBSDKProfile? Should I be using FBSDKShareOpenGraphValueContaining protocol?

For example, I have a method like so:

-exampleMethod: (NSDictionary<FBGraphUser> *) user

I was wondering how I should update this for SDK v4.2?

I have searched on Google, StackOverflow, and Reddit but have been unsuccessful. If someone could help me, that would be amazing!

Thanks for your help in advance and apologies for the ill-structured question.

like image 640
Aashay Avatar asked Nov 10 '22 11:11

Aashay


1 Answers

According to facebook upgrade guide

Graph API Update

Requests - FBSDKGraphRequest and FBSDKGraphRequestConnection are in FBSDKCoreKit and provide helpers to access the Graph API. They are very similar to FBRequest and FBRequestConnection in v3.x. By default they use [FBSDKAccessToken currentAccessToken] for issuing requests so you typically issue requests after login. For example:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me"
                                                                 parameters:nil];
  [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,

id result, NSError *error) { // TODO: handle results or error of request. }];

Batch Requests - As in v3.x, you construct a FBSDKGraphRequestConnection to add multiple requests to send in a batch.

FBViewController and related picker classes such as FBCacheDescriptor have been removed. If you want to display Graph API results in a table view, you can do it manually. Take a look at the Scrumptious or RPSSample for ideas to get started.

Take a look at the Scrumptious or RPSSample for ideas to get started

like image 152
Varun Naharia Avatar answered Nov 15 '22 13:11

Varun Naharia