views:

40

answers:

1

Hello,

I am trying to integrate facebook connect to my iphone app but I have an error (code 10000):

did fail: The operation couldn’t be completed. (facebookErrDomain error 10000.)

when In try to update my wall. The code seems pretty simple (I had to struggle to find some doc though), but...

- (void)viewDidLoad {
    [super viewDidLoad];

// Permissions
NSArray *permissions =  [[NSArray arrayWithObjects:@"publish_stream",@"read_stream",@"offline_access",nil] retain];     

// Connection 
Facebook *facebook = [[Facebook alloc] init];
[facebook authorize:@"MY_APP_ID" permissions:permissions delegate:self];

// Update my wall
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"MY_API_KEY", @"api_key", @"test", @"message", nil];
[facebook requestWithGraphPath:@"me/home" andParams:params andHttpMethod:@"POST" andDelegate:self];
}

// FBRequestDelegate

- (void)request:(FBRequest*)request didLoad:(id)result { 
NSArray* users = result; 
NSDictionary* user = [users objectAtIndex:0]; 
NSString* name = [user objectForKey:@"name"]; 
NSLog(@"Query returned %@", name); 
}

- (void)request:(FBRequest*)request didFailWithError:(NSError*)error {
    NSLog(@"did fail: %@", [error localizedDescription]);
}

- (void)request:(FBRequest*)request didReceiveResponse:(NSURLResponse*)response {
    NSLog(@"did r response");
}

Cannot really figure out what is wrong... Any clue ?

Thanks a lot,

Luc

A: 

Make sure you have declared your app's API key.

ibeitia
yes, I did use it.
Luc