解析facebook登录崩溃目标c

Posted

技术标签:

【中文标题】解析facebook登录崩溃目标c【英文标题】:Parse facebook login crashing objective c 【发布时间】:2016-04-05 05:26:29 【问题描述】:

我正在尝试使用 facebook 登录我的应用程序,但它不断从解析和 facebook 开发人员 guild 崩溃。这是我的代码。

-(IBAction)LoginWithFacebook 
    // Set permissions required from the facebook user account
    NSArray *permissionsArray = @[@"email", @"password", @"user_about_me", @"user_birthday", @"user_location"];

    [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) 
        if (!user) 
            NSLog(@"Uh oh. The user cancelled the Facebook login.");
         else if (user.isNew) 
            NSLog(@"User signed up and logged in through Facebook!");
         else 
            NSLog(@"User logged in through Facebook!");
        
    ];



   

这是我在崩溃时收到的错误消息。它很长,我不知道这一切意味着什么,我不确定这是否有帮助。

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSProxy doesNotRecognizeSelector:openWithBehavior:fromViewController:completionHandler:] called!'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000011301ed85 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001129c4deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000011301ecbd +[NSException raise:format:] + 205
    3   CoreFoundation                      0x0000000112f6dcfa ___forwarding___ + 970
    4   CoreFoundation                      0x0000000112f6d8a8 _CF_forwarding_prep_0 + 120
    5   RestaurentApp                       0x000000010f136b13 -[PFFacebookAuthenticationProvider authenticateAsync] + 627
    6   RestaurentApp                       0x000000010f133ffb +[PFFacebookUtils logInWithPermissionsInBackground:] + 122
    7   RestaurentApp                       0x000000010f134103 +[PFFacebookUtils logInWithPermissions:block:] + 71
    8   RestaurentApp                       0x000000010f0fcf90 -[LoginWithVC LoginWithFacebook] + 176
    9   UIKit                               0x0000000110fd8a8d -[UIApplication sendAction:to:from:forEvent:] + 92
    10  UIKit                               0x000000011114be67 -[UIControl sendAction:to:forEvent:] + 67
    11  UIKit                               0x000000011114c143 -[UIControl _sendActionsForEvents:withEvent:] + 327
    12  UIKit                               0x000000011114b263 -[UIControl touchesEnded:withEvent:] + 601
    13  UIKit                               0x000000011104b99f -[UIWindow _sendTouchesForEvent:] + 835
    14  UIKit                               0x000000011104c6d4 -[UIWindow sendEvent:] + 865
    15  UIKit                               0x0000000110ff7dc6 -[UIApplication sendEvent:] + 263
    16  UIKit                               0x0000000110fd1553 _UIApplicationHandleEventQueue + 6660
    17  CoreFoundation                      0x0000000112f44301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    18  CoreFoundation                      0x0000000112f3a22c __CFRunLoopDoSources0 + 556
    19  CoreFoundation                      0x0000000112f396e3 __CFRunLoopRun + 867
    20  CoreFoundation                      0x0000000112f390f8 CFRunLoopRunSpecific + 488
    21  GraphicsServices                    0x0000000114282ad2 GSEventRunModal + 161
    22  UIKit                               0x0000000110fd6f09 UIApplicationMain + 171
    23  RestaurentApp                       0x000000010f122aaf main + 111
    24  libdyld.dylib                       0x000000011374e92d start + 1
    25  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

【问题讨论】:

您可能还希望包含崩溃信息。没有人会猜到。 您的 Facebook 应用程序是否公开并可供所有用户使用? 我会确保检查@MuhammadAdnan @Avi 它所做的只是崩溃,我无法在 nslog 中调用错误,但我会提供我在日志中得到的内容 确保您启用了异常断点。 【参考方案1】:

也许问题是您使用的库太旧了,我也遇到了同样的问题。

这是两个主要步骤:

    使用 ParseFacebookUtilsV4.framework 代替 ParseFacebookUtils.frameworklogInWithPermissions 方法更改为 logInInBackgroundWithReadPermissions

【讨论】:

以上是关于解析facebook登录崩溃目标c的主要内容,如果未能解决你的问题,请参考以下文章

Facebook 登录按钮导致崩溃

Twitter登录 - 应用程序代理和应用程序崩溃中的线程1 Sigabrt错误

取消 Google Play 游戏登录后 Facebook 登录崩溃(反之亦然)

使用 facebook connect 登录后应用程序崩溃

如果用户取消登录,Swift ios facebook登录会使应用程序崩溃

iOS Facebook 登录“object nil”崩溃