Getting Random "Facebookerrdomain Error 10000"

Getting random facebookErrDomain error 10000

The problem was due to the fact that during the development I had changed the permissions requested by the application. I had authorized my application say with permission x,y,z but I was only asking for x,y.

What I had to do is to remove the application from the list of authorized applications and authorize it again with the appropriate permissions.

I wish they gave better error message :)

Facebook-iOS-sdk error The operation couldn’t be completed. (facebookErrDomain error 10000.)

Ok, so it turns out facebook sdk or any other idiotic piece of code wont give you the proper error message. I was sending params with a nil value when I needed to actually define the params I needed:

self.app_delegate.facebook.requestWithGraphPath("me/friends", andParams:{:fields => "name, picture, location"}, andDelegate:self)

Facebook graph API issue with the iOS SDK

Well, I've definitely found the Facebook SDK to be a little tricky myself, but here are a couple things I'm seeing that will hopefully help.

First off, I think you might have copied a couple methods incorrectly when entering the code accompanying your question. The allocation of the "facebook" object is where the delegate is set, and the "authorize" method only takes a NSMutableDictionary of parameters. For clarity's sake, the code should look like:

facebook = [[Facebook alloc] initWithAppId:@"00000000000000" andDelegate:self];
NSArray *permissions = [[NSArray arrayWithObjects:@"read_stream", @"publish_stream", @"offline_access",nil] retain];
[facebook authorize:permissions];
[facebook requestWithGraphPath:@"1342568689/feed" andDelegate:self];

Aside from that, the only real problem is that you are making a call to the graph API before the app has had time to be authorized completely. These calls are all done asynchronously, so as the main thread is moving on to your requestWithGraphPath:andDelegate call before the authorization process has actually returned a valid access token. You could move this call, or any other like it, into button onClick handler, or for a more direct test, into the Facebook Session Delegate method fbDidLogin.

Hope that helps!

How to upload video on facebook using facebook sdk 3.1 on iOS

I was able to upload a video to Facebook via Facebook graph API , check this:

http://developers.facebook.com/blog/post/2011/08/04/how-to--use-the-graph-api-to-upload-a-video--ios/

iPhone Facebook SDK Error

Here's how you can get the name and email...
I didn't test it so if it doesn't work just tell and I'll find out the problem.

The method that sends the request needs to authenticate if you don't have a valid access token

-(void)getUserFBInfo
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) {
self.facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
self.facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
if (![self.facebook isSessionValid]) {
NSLog(@"auth");
[self.facebook authorize:[NSArray arrayWithObject:@"email"]];
} else {
[self apiFQLIMe];
}
}

#pragma mark -
#pragma mark FBSessionDelegate

/**
* Called when the user successfully logged in.
*/
- (void)fbDidLogin
{
[self reportAction:@"FB allowed"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[self.facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[self.facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];
[self apiFQLIMe];
}

/**
* Called when the user dismissed the dialog without logging in.
*/
- (void)fbDidNotLogin:(BOOL)cancelled
{
NSLog("did not login");
}

/**
* Called after the access token was extended. If your application has any
* references to the previous access token (for example, if your application
* stores the previous access token in persistent storage), your application
* should overwrite the old access token with the new one in this method.
* See extendAccessToken for more details.
*/
- (void)fbDidExtendToken:(NSString*)accessToken
expiresAt:(NSDate*)expiresAt
{
NSLog(@"token extended");
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:accessToken forKey:@"FBAccessTokenKey"];
[defaults setObject:expiresAt forKey:@"FBExpirationDateKey"];
[defaults synchronize];
}

/**
* Called when the user logged out.
*/
- (void)fbDidLogout
{
NSLog("did logout")
}

/**
* Called when the current session has expired. This might happen when:
* - the access token expired
* - the app has been disabled
* - the user revoked the app's permissions
* - the user changed his or her password
*/
- (void)fbSessionInvalidated
{
[self.facebook authorize:[NSArray arrayWithObject:@"email"]];
}

#pragma mark -
#pragma mark FBRequestDelegate

- (void)apiFQLIMe {
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"SELECT name, first_name, middle_name, last_name, username, contact_email FROM user WHERE uid=me()", @"query",
nil];
[self.facebook requestWithMethodName:@"fql.query"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
}

/**
* Called when the Facebook API request has returned a response.
*
* This callback gives you access to the raw response. It's called before
* (void)request:(FBRequest *)request didLoad:(id)result,
* which is passed the parsed response object.
*/
- (void)request:(FBRequest *)request didReceiveResponse:(NSURLResponse *)response
{
DLog(@"received response");
}

/**
* Called when a request returns and its response has been parsed into
* an object.
*
* The resulting object may be a dictionary, an array or a string, depending
* on the format of the API response. If you need access to the raw response,
* use:
*
* (void)request:(FBRequest *)request
* didReceiveResponse:(NSURLResponse *)response
*/
- (void)request:(FBRequest *)request didLoad:(id)result
{
NSLog(@"%@",result);
// check the log to know how you receive the result
}

/**
* Called when an error prevents the Facebook API request from completing
* successfully.
*/
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error
{
NSLog(@"Err message: %@", [[error userInfo] objectForKey:@"error_msg"]);
NSLog(@"Err code: %d", [error code]);
}

If you have questions ask them in the comments



Related Topics



Leave a reply



Submit