facebook-ios-sdk

How to react to asynchronous events (login)?

℡╲_俬逩灬. 提交于 2019-12-30 07:53:08
问题 I am implementing some Facebook functionality in my iPhone app right now which needs an app login. The login itself isn't a problem any more, it's working. But due to the fact that the Facebook SDK works with events, I don't know how to perform my action as a reaction to a successful login. For example: I have a method - (void)refreshEvents; This method needs to call the login method to make sure that the action can actually be performed. So I call [self checkLogin] - but what now? How can I

com.facebook.sdk error 2 on iOS

隐身守侯 提交于 2019-12-28 05:56:28
问题 I have a Phonegap app that runs on both iOS and Android. The app has a Facebook login feature which worked until a few days ago. A few of our beta testers have reported an 'The operation couldn't be completed com.facebook.sdk error 2' error. The devices of these testers vary: iPhone 5, iPhone 4s, iPod Touch, iOS 5.1.1 and iOS 6.0. We use the latest Facebook SDK and a Phonegap Facebook login plugin (https://github.com/davejohnson/phonegap-plugin-facebook-connect/). I've done some research and

Handle invalid accessToken with FBSession openActiveSessionWithReadPermissions in Facebook iOS 3.1.1 SDK

帅比萌擦擦* 提交于 2019-12-28 03:55:10
问题 Before anything, I have read both this and this questions to solve the problem below and before asking. My problem is that when the accessToken gets expired (either because the expiration date passes, or manually by deleting the app from my Facebook's App Center) the following code: if ([[FBSession activeSession] isOpen]) { //do something } else { [FBSession openActiveSessionWithReadPermissions:nil allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error)

NSJsonSerialzation not parsing results from Facebook - Cocoa error 3840 [duplicate]

五迷三道 提交于 2019-12-25 18:40:35
问题 This question already has an answer here : The Operation couldn't be completed. (Cocoa error: 3840.) (1 answer) Closed 6 years ago . I'm authenticating with Facebook on my iOS application and use following method to grab the feed. When I check if it is valid JSON object, it returns true, but if I attempt to parse it, it gives me error: Mistake: The operation couldn’t be completed. (Cocoa error 3840.) What can be done about that? Here is what is arriving from server, perfectly valid JSON -

Howto add Modifiers to Graph API V2.0

烂漫一生 提交于 2019-12-25 18:13:32
问题 I'm trying to use Facebook GraphAPI 2.0 to fetch user's id, first_name, and the url of profile picture(with special size modifiers) with single request. Here are my attempts: If simply ask for picture, we can use: "me/picture?redirect=0&height=200&type=square&width=200" ==>It's successful. If ask batch of information without special requirement of picture, we use: "me?fields=id,picture,first_name" ==> It's also successful. Now, combining the two together, I tried: "me?fields=id,first_name

How do you get a Facebook photo's source URL using the facebook graph api?

 ̄綄美尐妖づ 提交于 2019-12-25 05:37:52
问题 Could you tell me how to use graph api to get the source url for a photo? Because I have the photo id and it seems like I should be able to make a call to get the source url. As an example of what I'm trying to do, the following code works: -(IBAction)showPicture:(UIButton *)sender; { //code to retrieve picture id path = @"http://photos-e.ak.fbcdn.net/photos-ak-snc1/v5041/89/51/40796308305/a40796308305_1960517_6704612.jpg"; NSURL *url = [NSURL URLWithString:path]; NSData *data = [NSData

Facebook iOS SDK login not functioning - NSException

柔情痞子 提交于 2019-12-25 02:52:16
问题 Followed numerous Facebook iOS SDK login guides including: https://developers.facebook.com/docs/facebook-login/ios/v2.3 http://www.brianjcoleman.com/tutorial-how-to-use-login-in-facebook-sdk-4-0-for-swift/ With accurate implementations of the Facebook and other guides the same problem is still occurring. When running the application the Log in button is clicked and then an NSException occurs at the start of the AppDelegate class (Error: "libc++abi.dylib: terminating with uncaught exception of

Authentication Error while extracting user information with Facebook Graph API

≡放荡痞女 提交于 2019-12-25 01:28:16
问题 I am trying to extract user's basic information through FBConnect latest SDK. My code is simple: - (void)viewDidLoad { [super viewDidLoad]; facebook = [[Facebook alloc] initWithAppId:fbAppId]; NSArray* permissions = [[NSArray arrayWithObjects:@"user_about_me",@"read_stream",nil]retain]; [facebook authorize:permissions delegate:self]; [facebook requestWithGraphPath:@"me" andDelegate:self]; NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: fbAppId, @"app_id",

Facebook SDK for iOS , on iOS 4.0 device

隐身守侯 提交于 2019-12-24 22:16:08
问题 Facebook SDK documents indicates that this SDK will work on iOS 4.0 and later. Then I tested their Scrumptions sample on a iPhone 3GS iOS 4.0 device. But it seems this application doesn't work. It keeps showing me the login screen although I logged in. Then I debugged and noticed FBSessionState always returns FBSessionStateClosedLoginFailed . It never returns FBSessionStateOpen . What could be the reason? However when I run this in iOS 5.1 emulator it works fine. Is it because SDK doesn't

Unable to share PDF URL on Facebook using SLComposeViewController

旧巷老猫 提交于 2019-12-24 14:34:34
问题 I have created sharing module for Titanium Appcelerator using social.framework. Following is my code: - (id) Facebook { //if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) //{ NSLog(@"Sharing via Facebook", nil); SLComposeViewController *fbSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [fbSheet setInitialText: [dictPost valueForKey: @"post"]]; [fbSheet addURL: [NSURL URLWithString: [dictPost valueForKey: @"link"]]];