swift – flutter_facebook_auth crashes on iOS. Nothing exhibits in debug console. Works superb on Android


Flutter Fb auth crashes onTap proper earlier than the road
remaining accessToken = await FacebookAuth.occasion;

Fb login operate crashes when tapping the button chargeable for the signInWithFacebook() operate. It crashes proper earlier than FacebookAuth.occasion. It appears to fail to get an occasion on iOS. Identical operate is used on Android and it’s working superb. iOS simulator is on iOS 16.4

That is my full code implementation:

  Map<String, dynamic>? _userData;
  AccessToken? _accessToken;
  LoginByFacebookModel? loginByFacebookModel;
  Future loginWithFacebook() async {
    attempt {
      emit(FacebookLoginLoadingState());
      _checkIfIsLogged();
      remaining LoginResult consequence = await FacebookAuth.occasion.login();
      if (consequence.standing == LoginStatus.success) {
        _accessToken = consequence.accessToken;
        logger.e(_accessToken?.userId);
        remaining userData = await FacebookAuth.occasion.getUserData();
        _userData = userData;
        logger.e({
          'identify': userData["name"],
          'facebook_id': userData["id"],
          'fcm_id': fcmToken,
        });

        remaining facebookCredential = FacebookAuthProvider.credential(
          consequence.accessToken!.token,
        );
      } else {
        enableUserInteraction();
      }
    } catch (e) {
      logger.e(e);
    }
  }

  Future<void> _checkIfIsLogged() async {
    remaining accessToken = await FacebookAuth.occasion.accessToken;

    if (accessToken != null) {
      // ignore: unused_local_variable
      remaining userData = await FacebookAuth.occasion.getUserData();
      _accessToken = accessToken;
    }
  }

It instantly crashes app and provides me this log from macOS

Incident Identifier: F726195B-600E-4A9F-A3E8-7B7267C04FFB
CrashReporter Key:   3FC162F1-D3A9-C808-CD10-88D82B254374
{Hardware} Mannequin:      MacBookAir10,1
Course of:             Runner [31872]
Path:                /Customers/USER/Library/Developer/CoreSimulator/Units/6CE6184C-42E6-498F-BCD2-BBF0DDDD7E97/knowledge/Containers/Bundle/Utility/76F8AE18-6CA1-4BDE-9A32-34B0843B920C/Runner.app/Runner
Identifier:          com.mediaworldsoftware.abee
Model:             1.0.0 (8)
Code Kind:           ARM-64 (Native)
Function:                Foreground
Father or mother Course of:      launchd_sim [1241]
Coalition:           com.apple.CoreSimulator.SimDevice.6CE6184C-42E6-498F-BCD2-BBF0DDDD7E97 [931]
Accountable Course of: SimulatorTrampoline [764]

Date/Time:           2023-11-14 10:34:48.2210 +0300
Launch Time:         2023-11-14 10:34:26.5423 +0300
OS Model:          macOS 13.2.1 (22D68)
Launch Kind:        Consumer
Report Model:      104

Exception Kind:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Final Exception Backtrace:
0   CoreFoundation                         0x180437324 __exceptionPreprocess + 160
1   libobjc.A.dylib                        0x180051274 objc_exception_throw + 56
2   FBSDKCoreKit                           0x104aaf0a8 -[FBSDKInternalUtility validateFacebookReservedURLSchemes] + 0 (FBSDKInternalUtility.m:468)
3   FBSDKLoginKit                          0x1047098ec LoginManager.logInParameters(configuration:loggingToken:authenticationMethod:) + 376 (LoginManager.swift:515)
4   FBSDKLoginKit                          0x104707724 LoginManager.performBrowserLogIn(handler:) + 1128 (LoginManager.swift:641)
5   FBSDKLoginKit                          0x104710df4 specialised LoginManager.logIn(permissions:handler:) + 800
6   FBSDKLoginKit                          0x1047062f4 LoginManager.commonLogIn(from:configuration:completion:) + 308
7   FBSDKLoginKit                          0x104706c7c LoginManager.logIn(permissions:from:handler:) + 464
8   flutter_facebook_auth                  0x10506cb00 FacebookAuth.login(permissions:flutterResult:) + 540 (FacebookAuth.swift:93)
9   flutter_facebook_auth                  0x10506bed0 FacebookAuth.deal with(_:consequence:) + 928 (FacebookAuth.swift:44)
10  flutter_facebook_auth                  0x105071504 SwiftFlutterFacebookAuthPlugin.deal with(_:consequence:) + 128 (SwiftFlutterFacebookAuthPlugin.swift:18)
11  flutter_facebook_auth                  0x105071598 @objc SwiftFlutterFacebookAuthPlugin.deal with(_:consequence:) + 124
12  Flutter                                0x109945ab0 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 172
13  Flutter                                0x108f37a40 invocation operate for block in flutter::PlatformMessageHandlerIos::HandlePlatformMessage(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::PlatformMessage, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::PlatformMessage> >) + 108
14  libdispatch.dylib                      0x180132ee4 _dispatch_call_block_and_release + 24
15  libdispatch.dylib                      0x180134708 _dispatch_client_callout + 16
16  libdispatch.dylib                      0x180143fd8 _dispatch_main_queue_drain + 1220
17  libdispatch.dylib                      0x180143b04 _dispatch_main_queue_callback_4CF + 40
18  CoreFoundation                         0x18039a784 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
19  CoreFoundation                         0x180394de4 __CFRunLoopRun + 1912
20  CoreFoundation                         0x180394254 CFRunLoopRunSpecific + 584
21  GraphicsServices                       0x188eb7c9c GSEventRunModal + 160
22  UIKitCore                              0x10d4daff0 -[UIApplication _run] + 868
23  UIKitCore                              0x10d4def3c UIApplicationMain + 124
24  Runner                                 0x1040e2b08 foremost + 64 (AppDelegate.swift:6)
25  dyld_sim                               0x104351514 start_sim + 20
26  dyld                                   0x104545e50 begin + 2544
27  ???                             0x7757000000000000 ???

What’s inflicting this problem?

re implementing Login with Fb. Nonetheless crashing on button faucet.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles