I m building an iPhone App where i want to add Facebook login. In viewDidLoad i ve added:
facebook = [[Facebook alloc] initWithAppId:@"MYAPPID" andDelegate:self];
facebook.sessionDelegate=self;
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
当用户点击按钮时, 我引用一个函数, 即:
NSArray *permissions = [[NSArray arrayWithObjects:@"read_stream", @"publish_stream", @"offline_access",nil] retain];
[facebook authorize:permissions ];
It launches safari and makes the facebook login; the problem is that when it returns to the app, it relaunches the app, while i need to return directly to my ViewController, not to the FirstViewController. What am i doing wrong?