3

当用户使用 Facebook 登录时,我试图找出崩溃的 ios 应用程序。该错误并非每次都重现,我只有很少的关于此问题的报告和一个崩溃日志:

Process:         Facebook [2417]
Path:            /var/mobile/Applications/ADF140E7-A40C-40A2-BC99-7E558C528F97/Facebook.app/Facebook
Identifier:      Facebook

Exception Type:  EXC_CRASH (SIGBUS)

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3b7c9f04 semaphore_wait_trap + 8
1   libdispatch.dylib               0x3b6f92fc _dispatch_thread_semaphore_wait$VARIANT$mp + 8
2   libdispatch.dylib               0x3b6f787c _dispatch_barrier_sync_f_slow + 96
3   QuartzCore                      0x351829d2 CABackingStoreGetFrontTexture(CABackingStore*) + 50
4   QuartzCore                      0x35198012 CABackingStorePrepareFrontTexture + 38
5   QuartzCore                      0x35175b24 CA::Layer::prepare_commit(CA::Transaction*) + 428
6   QuartzCore                      0x35175246 CA::Context::commit_transaction(CA::Transaction*) + 242
7   QuartzCore                      0x3517504c CA::Transaction::commit() + 312
8   UIKit                           0x3543a0ce -[UIApplication _reportAppLaunchFinished] + 38
9   UIKit                           0x3556ffee -[UIApplication _handleApplicationResumeEvent:] + 1358
10  UIKit                           0x353c7d54 -[UIApplication handleEvent:withNewEvent:] + 1288
11  UIKit                           0x353c76c8 -[UIApplication sendEvent:] + 68
12  Facebook                        0x004a4b3c 0x1d000 + 4750140
13  UIKit                           0x353c7116 _UIApplicationHandleEvent + 6150
14  GraphicsServices                0x370dd5a0 _PurpleEventCallback + 588
15  GraphicsServices                0x370dd1ce PurpleEventCallback + 30
16  CoreFoundation                  0x33594170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
17  CoreFoundation                  0x33594112 __CFRunLoopDoSource1 + 134
18  CoreFoundation                  0x33592f94 __CFRunLoopRun + 1380
19  CoreFoundation                  0x33505eb8 CFRunLoopRunSpecific + 352
20  CoreFoundation                  0x33505d44 CFRunLoopRunInMode + 100
21  GraphicsServices                0x370dc2e6 GSEventRunModal + 70
22  UIKit                           0x3541b2fc UIApplicationMain + 1116
23  Facebook                        0x0001fbd0 0x1d000 + 11216
24  Facebook                        0x0001fb94 0x1d000 + 11156

我已经在子存储库中将 ShareKit 库与更新的 Facebook 版本集成,但我将 Facebook.h 导入到 ApplicationDelegate 类中,并通过http://developers.facebook.com/docs/中的步骤直接使用它进行授权教程/ios-sdk-tutorial/authenticate/

请告诉我在崩溃日志中查找问题的方法是什么?

ApplicationDelegate 类包含:

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    ....
    [FBSession.activeSession handleDidBecomeActive];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    ....  
    [FBSession.activeSession close];
}


/*
 * If we have a valid session at the time of openURL call, we handle
 * Facebook transitions by passing the url argument to handleOpenURL
 */
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    [ProgressHUD displayProcessingIndicator];

    // attempt to extract a token from the url
    return [FBSession.activeSession handleOpenURL:url];
}

/*
 * Callback for session changes.
 */
- (void)sessionStateChanged:(FBSession *)session state:(FBSessionState) state error:(NSError *)error
{
    switch (state) {
        case FBSessionStateOpen:
            if (!error) {
                // We have a valid session
            }
            break;
        case FBSessionStateClosed:
        case FBSessionStateClosedLoginFailed:    
            [FBSession.activeSession closeAndClearTokenInformation];
            break;
        default:
            break;
    }

    [[NSNotificationCenter defaultCenter] postNotificationName:@"FacebookSessionStateChangeNotification"
                                                        object:session];

    if (error) {
        [ProgressHUD hideIndicator];
    }
}

/*
 * Opens a Facebook session and optionally shows the login UX.
 */
- (void)openFacebookSession
{
    // To using the internal ios6 integration, call openActiveSessionWithReadPermissions method
    #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    [FBSession openActiveSessionWithPermissions:[NSArray arrayWithObject:@"email"]
                                   allowLoginUI:YES
                              completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                  [self sessionStateChanged:session state:state error:error];
                              }];
    #pragma GCC diagnostic warning "-Wdeprecated-declarations"
}

- (void)closeFacebookSession
{
    if (FBSession.activeSession.isOpen) {
        [FBSession.activeSession closeAndClearTokenInformation];
    }
}

非常感谢。

4

0 回答 0