我花了几天时间通过应用程序做一个简单的Facebook帖子。我使用了这个tutorial,发现没有调用fbDidLogin。由于我一直在寻找解决方案,我发现this是一种使fbDidLogin被调用的方法。
启发我可能会错过的内容。
这里附有我app delegate
中FB集成的基本方法。
App delegate.m
@synthesize window = _window;
@synthesize wallSnapVC = _wallSnapVC;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.wallSnapVC = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"wallSnapViewController"];
self.window.rootViewController = self.wallSnapVC;
[self.window makeKeyAndVisible];
return YES;
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [[_wallSnapVC facebook] handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [[_wallSnapVC facebook] handleOpenURL:url];
}