iPhone应用程序的第一个Facebook连接授权/登录后崩溃 [英] iPhone app crashes after first Facebook Connect authorization / login
问题描述
我一直在寻找一个答案无处不在,但无法找到一个。结果
问题是:
I've been looking for an answer everywhere but couldn't find one.
The problem is:
- 我有一个iPhone应用程序(在AppStore上),使用 Facebook的iPhone SDK 。
- 我使用的SDK以下列方式授权用户:
NSArray *permissions = [NSArray arrayWithObjects: @"offline_access",
@"publish_stream", @"user_birthday", @"user_hometown", @"user_interests",
@"user_location", @"email" ,nil];
[((MyAppDelegate *)AppDelegate).facebook authorize:permissions delegate:self];
在AppDelegate中我有这样的code:
In the AppDelegate I have this code:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [self.facebook handleOpenURL:url];
}
和现在:结果
- 该SDK打开Safari浏览器,并显示众所周知Facebook的授权屏幕结果。
- 用户presses的允许按钮结果。
- iOS设备试图返回到应用程序..结果
- 但是 - BAM! - 崩溃! - 在应用程序启动回来!
And now:
- The SDK opens Safari and displays the well known facebook authorization screen.
- User presses the "allow" button.
- iOS tries to return to the app..
- But then - BAM! - CRASH! - Before application launched back!!
非常重要:
- 用户遇到此崩溃只在第一次启动后安装的应用程序。结果
当他们崩溃的一切完美的作品后,再次打开该应用程序,他们甚至已登入 - 这种情况不能被复制之后,即使用户卸载应用程序,并重新安装。它发生仅在第一个推出第一款安装。
真正需要帮助这里。我的用户中有90%获得生产这种崩溃。结果
非常感谢。
Really need help here. 90% of my users get this crash on production.
Thanks a lot.
推荐答案
在这一行:
[((MyAppDelegate *)AppDelegate).facebook authorize:permissions delegate:self];
您设定的委托自
这样的类必须实现 FBSessionDelegate
这些功能:
you set the delegate to self
so that class must implement FBSessionDelegate
with these functions:
(void)fbDidLogin;
(void)fbDidNotLogin:(BOOL)cancelled;
(void)fbDidLogout;
这篇关于iPhone应用程序的第一个Facebook连接授权/登录后崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!