Login with facebook Error Code=7 in IOS -
in application
acaccountstore *accountstore = [[acaccountstore alloc] init]; acaccounttype *fb_account_type = [accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifierfacebook]; // specify app id , permissions nsdictionary *dictfb = @{ acfacebookappidkey:@"523377051045933", acfacebookpermissionskey: @[@"email"], acfacebookaudiencekey: acfacebookaudiencefriends }; [accountstore requestaccesstoaccountswithtype:fb_account_type options:dictfb completion:^(bool granted, nserror *e) { if (granted) { nsarray *accounts = [accountstore accountswithaccounttype:fb_account_type]; // nslog(@"facebook business relationship = %@",[accounts lastobject]); acaccount *fb_account = [accounts lastobject]; // access token, used in other scenarios acaccountcredential *fbcredential = [fb_account credential]; nsstring *accesstoken = [fbcredential oauthtoken]; // nslog(@"facebook access token: %@", accesstoken); [[nsuserdefaults standarduserdefaults] setobject:accesstoken forkey:@"fb_token"]; [[nsuserdefaults standarduserdefaults] synchronize]; [self performselectoronmainthread:@selector(loginwithfacebookok) withobject:nil waituntildone:no]; } #if debug else { nslog(@"error getting permission %@",e); } #endif [self.progressview hidewithanimated:yes]; }];
when effort login facebook error generated
error getting permission error domain=com.apple.accounts code=7 "the operation couldn’t completed. (com.apple.accounts error 7.)" invalid application fb_app_id" userinfo=0xb461770 {nslocalizeddescription=the facebook server not fulfill access request: invalid application fb_app_id}
my code right why error generate. add together fb business relationship in iphone settings.
ios facebook login
No comments:
Post a Comment