6

मैं फेसबुक से मूलभूत उपयोगकर्ता जानकारी प्राप्त करना चाहते हैं का उपयोग कर फेसबुक से उपयोगकर्ता जानकारी प्राप्त हो रही है, लेकिन निम्नलिखित कोडग्राफ एपीआई

-(void)checkForAccessToken:(NSString *)urlString { 
    NSError *error; 
    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"access_token=(.*)&" options:0 error:&error]; 
    if (regex != nil) { 
     **NSTextCheckingResult *firstMatch = [regex firstMatchInString:urlString options:0 range:NSMakeRange(0, [urlString length])]; 
     if (firstMatch) { 
      NSRange accessTokenRange = [firstMatch rangeAtIndex:1]; 
      NSString *accessToken = [urlString substringWithRange:accessTokenRange]; 
      accessToken = [accessToken stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
      [_delegate accessTokenFound:accessToken];    
     }** 
    } 
} 

में कुछ समस्या हो रही firstMatch में मैं शून्य है कि हो रही है क्यों [_delegate accessTokenFound: accessToken ]; इन तरीकों को बुलाया नहीं जाता है।

किसी कृपया मेरी मदद कर सकते बाहर इतना है कि मैं पहले से फेसबुक

से

धन्यवाद उपयोगकर्ता जानकारी करने में सक्षम होगा।

+0

आप फेसबुक एसडीके का उपयोग कर रहे के बाद fbdid प्रवेश विधि? आधिकारिक ग्राफ एपीआई का उपयोग करने के बजाय आप उस तरह से पहुंच टोकन क्यों प्राप्त करना चाहते हैं? – vinzenzweber

+0

आपको आमतौर पर फेसबुक देव मैनुअल में सुझाए गए अनुसार करना होगा: https://developers.facebook.com/docs/mobile/ios/build/#graph – vinzenzweber

उत्तर

3

कॉल एप्लिकेशन आईडी और credentials.- साथ यह initialising

(void)fbDidLogin { 

NSLog(@"fbDidLogin"); 
isFacebookLoaded=YES; 


NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; 
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; 
[defaults synchronize]; 
NSLog(@"i am in and my acees token is %@ %@ and call me.CALLshowAloadingView",[facebook accessToken],[facebook expirationDate]) ; 
[self.facebook requestWithGraphPath:@"me" andDelegate:self]; 
if ([delegate respondsToSelector:@selector(showAloadingView)]) 
{ 
    NSLog(@" CALLshowAloadingView"); 
    // calling delegate method. For this method to function, the delegate should be implemented in the calling class. 
    [delegate showAloadingView];     
} 


// Inform the delegate that Login is successful 
if ([delegate respondsToSelector:@selector(loginStatus:)]) { 
    // calling delegate method. For this method to function, the delegate should be implemented in the calling class. 
    [delegate loginStatus:YES];     
    return; 
} 

}