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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With