iphone - Can't post to facebook wall with iOS SDK (authorization issue) -
first create facebook object appid:
facebook = [[facebook alloc] initwithappid:kappid];
when call
[_facebook authorize:_permissions delegate:self]
my safari opens , after enter fb username , password, safari closes , returns app (like should). permissions are:
_permissions = [[nsarray arraywithobjects:@"read_stream", @"publish_stream", @"offline_access",nil] retain];
the strange thing delegate method - (void)fbdidlogin or -(void)fbdidnotlogin:(bool)cancelled not called in fb sample app comes sdk. in .h file implement protocols "fbrequestdelegate, fbdialogdelegate, fbsessiondelegate" , in .m file have necessary methods.
if try make post after with
[_facebook requestwithgraphpath:@"me/feed" andparams:[nsmutabledictionary dictionarywithobject:@"test wall post" forkey:@"message"] andhttpmethod:@"post" anddelegate:self];
i error "req failed error operation couldn’t completed. (facebookerrdomain error 10000.)". must related authorization, since no message after authorize call, don't know do.
any ideas?
nsmutabledictionary *params = [nsmutabledictionary dictionarywithobjectsandkeys: @"my new status message", @"message", nil]; [_facebook requestwithgraphpath:@"/me/feed" andparams:params andhttpmethod:@"post" anddelegate:self];
or
the error object returned has details what's happening. suggest implement method more infos:
- (void)request:(fbrequest *)request didfailwitherror:(nserror *)error { nslog(@"%@", [error localizeddescription]); nslog(@"err details: %@", [error description]); };
for example problem gived me info, , i've fixed it:
2011-05-27 11:19:57.313 challengein[7704:207] operation couldn’t completed. (facebookerrdomain error 10000.) 2011-05-27 11:19:57.314 challengein[7704:207] err details: error domain=facebookerrdomain code=10000 "the operation couldn’t completed. (facebookerrdomain error 10000.)" userinfo=0x6878b90 {error=<cfbasichash 0x6879be0 [0x141c400]>{type = mutable dict, count = 2, entries => 2 : <cfstring 0x6877f70 [0x141c400]>{contents = "type"} = <cfstring 0x686f9a0 [0x141c400]>{contents = "oauthexception"} 3 : <cfstring 0x686d610 [0x141c400]>{contents = "message"} = <cfstring 0x686f970 [0x141c400]>{contents = "(#100) picture url not formatted"} } }
please try link http://www.capturetheconversation.com/technology/-facebook-oauth-2-0-and-the-graph-api-a-tutorial-part-2
Comments
Post a Comment