facebook-ios-sdk

No FBSession in Facebook iOS SDK 4.x

ⅰ亾dé卋堺 提交于 2019-11-30 16:36:52
问题 There is no more class FBSession in new Facebook iOS SDK v4.x. How can I find out whether user is logged in or not now? Thanks in advance. 回答1: Vincent is right, check [FBSDKAccessToken currentAccessToken] to determine if the user is logged in. 回答2: To check if the user logged in and if so, navigate to another view: if ([FBSDKAccessToken currentAccessToken]) { // User is logged in [self performSelector:@selector(accessGrantedNavigation) withObject:nil afterDelay:0.0]; } -(void

Posting to open graph does not show object title in the post

馋奶兔 提交于 2019-11-30 14:17:56
问题 I have created a restaurant app on Facebook and have created a custom story with the action type: "eat", and object type: "dish". When the user posts to Facebook I would like the title sentence of the post to contain the title of the dish that the user has selected, for example: "Bob ate Pie on Restaurant App" At the moment when I post to Facebook the result that I am getting is: "Bob ate a dish on Restaurant App". Everything else about the post is working as intended. Here is the code that I

How to use Facebook deferred deep linking feature for new installs and to test the same before publishing iOS App to appStore?

落爺英雄遲暮 提交于 2019-11-30 12:41:56
问题 I have done some exploration and have found the following things, this is what I have done so far: Implemented custom URL, like myApp:// Added FacebookAppID, display name to my info.plist file Included the Facebook SDK Created Facebook app link through Facebook mobile hosting API and got the URL something like: https://fb.me/1601524146753610 Used the above URL as deep link while creating app-install Ads. Implemented the below function in my AppDelegate.m - (BOOL)application:(UIApplication *

How to post to a friends Wall using Facebook Graph API for iPhone

北城余情 提交于 2019-11-30 12:22:17
问题 I want to post something in the users friends wall. I use this to post into the user wall SBJSON *jsonWriter = [[SBJSON new] autorelease]; NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil]; NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: @"a long run", @"name", @"The Facebook Running app",

ios6 facebook integration login always FBSessionStateClosedLoginFailed never opens

回眸只為那壹抹淺笑 提交于 2019-11-30 11:18:12
this question is very similar to Facebook SDK for iOS , on iOS 4.0 device , but as I cannot make comments there, I open a new question. I think the questions are not the same: When trying to update the facebook integration of my app to facebook 3.1 I am not getting the facebook session to open the sessionStateChanged Callback always ends up in FBSessionStateClosedLoginFailed. in my setup I have the callback in my appdelegate - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // attempt to extract a

Choosing 'Not Now' when accepting app causes “com.facebook.sdk error2”

℡╲_俬逩灬. 提交于 2019-11-30 10:10:29
Using Facebook iOS SDK 3.1. When choosing not to allow a 'Connect' to a Facebook app, I'm stuck with Facebook throwing "com.facebook.sdk error2." errors at me, even after re-installing my app. Steps to reproduce: Choose to connect with Facebook Select 'Not Now' in the UIAlertView that pops up => I can't choose to connect again. The only way for the user to connect again is to remove her Facebook account from Settings and add it again. Is this a bug in the Facebook SDK or am I missing something? I've obviously followed the authorization tutorial and everything works just fine (auth, posting

Posting to open graph does not show object title in the post

*爱你&永不变心* 提交于 2019-11-30 10:04:30
I have created a restaurant app on Facebook and have created a custom story with the action type: "eat", and object type: "dish". When the user posts to Facebook I would like the title sentence of the post to contain the title of the dish that the user has selected, for example: "Bob ate Pie on Restaurant App" At the moment when I post to Facebook the result that I am getting is: "Bob ate a dish on Restaurant App". Everything else about the post is working as intended. Here is the code that I am using: NSMutableDictionary <FBOpenGraphObject> *dish = [FBGraphObject

Cocoapods use_frameworks! import issue

北城以北 提交于 2019-11-30 08:21:11
I want to use some Swift pods in my Objective-C app, so I need to use frameworks instead of static libraries. But enabling use_frameworks! in my Podfile causes tones of #import errors. My Podfile: platform :ios, '8.0' use_frameworks! pod 'AFNetworking', '2.6.0' pod 'Typhoon' pod 'SSKeychain' pod 'JBWebViewController' pod 'TTTAttributedLabel' pod 'HockeySDK' pod 'GoogleAnalytics' pod 'Intercom' pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'UIButton+Activity' pod 'HexColors' pod 'AFNetworkActivityLogger' pod 'HCSStarRatingView', :git => 'https://github.com/hsousa/HCSStarRatingView.git' pod

iOS Facebook SDK: An active access token must be used to query information about the current user

一笑奈何 提交于 2019-11-30 07:03:11
I have followed many examples and looked at many questions regarding this access token error, but I can't seem to find out why I am getting it or how to fix it. I init Facebook like they do in the 3.1 sdk examples: NSArray* permissions = [[NSArray alloc] initWithObjects:@"publish_stream", @"publish_actions", nil]; self.fb = [[FBSession alloc] initWithPermissions:permissions]; [self.fb openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { [self sessionStateChanged:session :status :error]; }]; This works fine and the user is asked to accept the app permissions

How to post a photo. iOS Facebook SDK 3.1

◇◆丶佛笑我妖孽 提交于 2019-11-30 07:02:06
I needed to publish a picture on my wall. The pic is generated in my iPad app. This is the simplest way I've found - (void) postImageToFB:(UIImage*)image { NSData* imageData = UIImageJPEGRepresentation(image, 90); NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"This is my drawing!", @"message", imageData, @"source", nil]; [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { }]; } if you want to post on a friend's wall, change @"me/photos" by