简体   繁体   中英

Facebook iOS SDK Hang at App Start

I have not started any of facebook view or method in appDidFinishLoadingWithOptions: but stil when I start app at first, then stop and restart it, it hangs. If i press the pause button i can see the stack trace shown in image.

堆栈跟踪图像

This code in method applicationDidBecomeActive was creating the issue. Anyone know what can be a possible reason. Removing this solved my issue.

- (void)applicationDidBecomeActive:(UIApplication *)application {

if (FBSession.activeSession.state == FBSessionStateCreatedOpening) {
[FBSession.activeSession close]; // so we close our session and start over
}

if (FBSession.activeSession.isOpen) {
}

}

Actually you have to navigate the page to another view controller so try this.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];

UIViewController *splashController = [[UIViewController alloc]init];
UINavigationController *detailednewscontroller=[[UINavigationController alloc]initWithRootViewController:splashController];
[self.window setRootViewController:detailednewscontroller];
[self.window makeKeyAndVisible];
return YES;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM