facebook - - (void)request:(FBRequest *)request didLoad:(id)result not called -


why method never called? can me review code, green hand.

here *.h file

@interface loginviewcontroller : uiviewcontroller <fbsessiondelegate,fbrequestdelegate,fbdialogdelegate> {      facebook *facebook;     iboutlet uitextfield *_txt;     nsstring *facebookuserid; 

i want faceboo user id,so called api '[facebook requestwithgraphpath:@"me" anddelegate:self];'

- (void) fbdidlogin {     nslog(@"[login] used did login");     nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults];     [defaults setobject:[facebook accesstoken] forkey:@"fbaccesstokenkey"];     [defaults setobject:[facebook expirationdate] forkey:@"fbexpirationdatekey"];     [defaults synchronize];     // user has logged in facebook, userid facebook      [facebook requestwithgraphpath:@"me" anddelegate:self];      } 

i know below method user id,but never called.

- (void)request:(fbrequest *)request didload:(id)result  {     nslog(@"inside didload");          if ([result iskindofclass:[nsarray class]])     {         result = [result objectatindex:0];     }     // when ask user infor happen.     if ([result iskindofclass:[nsdictionary class]])     {         //nsdictionary *hash = result;                  nslog(@"name: %@", [result objectforkey:@"name"]);          self.facebookuserid = [result objectforkey:@"id"];         nslog(@"id: %@", [result objectforkey:@"id"]);     } } 

you need implement openurl or handleopenurl (the latter prior ios 4.2). needs implemented in app delegate, not view controller.

see fbdidlogin not called. openurl result in fbdidlogin getting called

- (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation {     nslog(@"============handle open url");     viewcontroller *v =(viewcontroller *) vc;     return [[v facebook] handleopenurl:url];  } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -