• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Facebook Connect Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Facebook Connect Problem


  • Subject: Facebook Connect Problem
  • From: Austin Ray <email@hidden>
  • Date: Wed, 20 Jan 2010 00:22:41 -0800

If this isn't the right place to ask this question, can you redirect me please?

So I've been messing with facebook connect for about 10 hours now, and I still am not able to send a query using fql to Facebook and get back anything let alone keep my app from crashing. Basically, when I try to log in, it never calls the session:didLogin: function, where I'm trying to send my query from. And when I try to send it manually, the console says:

2010-01-19 22:44:49.821 Facebook[3396:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: session_key)'
2010-01-19 22:44:49.823 Facebook[3396:207] Stack (
29373531,
2446402825,
29457467,
29457306,
162565,
23131,
9411,
2802777,
3210146,
3218883,
3214095,
2907699,
2816028,
2842805,
37469905,
29158272,
29154376,
37463949,
37464146,
2846723,
8516,
8370
)

PLEASE HELP ME!!!!!!!! I've provided my source files below.

Here's my header:

//
// FacebookViewController.h
// Facebook
//
// Created by Austin on 1/19/10.
// Copyright Dunham Academy 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FBConnect/FBConnect.h"

@interface FacebookViewController : UIViewController <FBSessionDelegate, FBRequestDelegate> {
FBSession *session;
}
//method called when I press button on screen
-(IBAction)Query;

@end





Here's my implementation:

//
// FacebookViewController.m
// Facebook
//
// Created by Austin on 1/19/10.
// Copyright Dunham Academy 2010. All rights reserved.
//

#import "FacebookViewController.h"
#import "FBConnect/FBSession.h"

@implementation FacebookViewController



/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Custom initialization
}
return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
session = [[FBSession sessionForApplication:@"Actual API KEY" secret:@"Actual Secret Key" delegate:self] retain];
FBLoginButton* button = [[[FBLoginButton alloc] init] autorelease];
[self.view addSubview:button];
}

-(IBAction)Query {
NSString* fql = [NSString stringWithFormat:@"select uid,name from user where uid == %lld", aVariableForMyUserIDWhichIKnow];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];

}

- (void)request:(FBRequest*)request didLoad:(id)result {

NSLog(@"awesome");
}

- (void)request:(FBRequest*)request didFailWithError:(NSError*)error {

}

- (void)session:(FBSession*)session didLogin:(FBUID)uid {
//This NSLog has never gotten displayed, which means this function has never been called... weird
NSLog(@"hi");
NSString* fql = [NSString stringWithFormat:@"select uid,name from user where uid == %lld", uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
}

- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
[session logout];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)dealloc {
[super dealloc];
[session.delegates removeObject: self];
[session release], session = nil;
}

@end
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Facebook Connect Problem
      • From: Jens Miltner <email@hidden>
  • Prev by Date: Re: Why does IB insist on putting NSTextView in an NSScrollView
  • Next by Date: Re: Facebook Connect Problem
  • Previous by thread: Re: Virgin, vanilla 10.6.2 + Xcode 3.2.1/iPhone SDK 3.1.2: crashes trying to view the "Getting started with Xcode" documentation
  • Next by thread: Re: Facebook Connect Problem
  • Index(es):
    • Date
    • Thread