facebook登录(集成FBSDKLoginKit) result的isCancelled总是YES token为nil

只需要在AppDelegate如下函数添加:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
{  
    return [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}

因为重写了上面这个函数, 就不会调用如下函数:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}

所以就会出现这种错误...

posted @ 2016-11-16 09:53  Rinpe  阅读(1276)  评论(0编辑  收藏  举报