I want to get basic user information from Facebook, but have some problems in the following code
-(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]; }** } }
In firstMatch, I get NULL, so [_delegate accessTokenFound: accessToken]; these methods are not called.
Can someone please help me so that I can receive information from Facebook
Thanks in advance.
source share