How to send add friend request (to facebook user) from iOS application?

For user-to-user requests, you can do this (using ARC): NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: message, @”message”, title, @”title”, nil]; [[self facebook] dialog: @”apprequests” andParams: [params mutableCopy] andDelegate: delegate]; For app-to-user requests, you can do this: NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: message, @”message”, nil]; [[self facebook] requestWithGraphPath: @”[FRIEND ID]/apprequests” andParams: [params mutableCopy] andHttpMethod: @”POST” andDelegate: delegate]; … Read more

Handle invalid accessToken with FBSession openActiveSessionWithReadPermissions in Facebook iOS 3.1.1 SDK

The questions you linked are relevant, especially Facebook SDK 3.1 – Error validating access token which explains the problem where the Facebook account on the device is out of sync with the server (I.e., if you deleted the app from App Center). As mentioned there, in 3.1.1 the SDK will call to renew the device … Read more

How can I convert FBProfilePictureView to an UIImage?

FBProfilePictureView is a UIView, this UIView contains a UIImageView, that is your image, you can get the UIImage from that UIImageView: profilePictureView is a FBProfilePictureView UIImage *image = nil; for (NSObject *obj in [profilePictureView subviews]) { if ([obj isMemberOfClass:[UIImageView class]]) { UIImageView *objImg = (UIImageView *)obj; image = objImg.image; break; } } EDIT: add another … Read more

“apprequests” dialog reports success, recipients receive nothing

Found an explanation that helped me fix this here: http://facebook.stackoverflow.com/a/8211249/184561 When a user clicks on an app request, Facebook takes them to your Facebook canvas page. If you don’t have a canvas page, the requests don’t show up. As soon as I added a canvas url (one that didn’t even work), the requests started showing … Read more

Facebook iOS8 SDK build module error for FBSDKCoreKit

FBSDKCoreKit can’t be built because of “include of non-modular header inside framework module” error in FBSDKAppLinkResolver.h header file: in #import <Bolts/BFAppLinkResolving.h> line. The solution from Swift compiler error: “non-modular header inside framework module” (switching CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES) did’t help me. My solution: Create in Bolts.framework file module map: Modules/module.modulemap (like in FBSDKCoreKit.framework) Put such code … Read more

IOS Facebook SDK – Post Open Graph and show on Timeline without clicking Activity Log

I’ve moved this answer out of @isaacselement question. Just add one more code to your FBOpenGraphAction Object: id<FBOpenGraphAction> action = (id<FBOpenGraphAction>) [FBGraphObject graphObject]; [action setObject: @”true” forKey: @”fb:explicitly_shared”]; // This is the key point! And you should enable the ‘explicitly shared’ setting for the open graph action in the Facebook Developer App Dashboard in the … Read more

FBSDKLoginManager logInWithPublishPermissions always returns isCancelled=YES

You should try adding in your AppDelegate didFinishLaunchingWithOptions : return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; This would get u [FBSDKAccessToken currentAccessToken] when user is logged in. and – (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } If this method is not present into AppDelegate then it results into … Read more