Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook for Flutter App Crashes on IOS and works fine on Android

App for unknown Reasons Crashes on pressing on facebook login button for IOS but it's working perfectly on android for unknown reasons ,, if anyone faced this problem please tell how to you solved it

here is the error

*** First throw call stack:
(
    0   CoreFoundation                      0x000000010ad5229b __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x000000010a2ee735 objc_exception_throw + 48
    2   FBSDKCoreKit                        0x0000000107cee01e +[FBSDKInternalUtility validateURLSchemes] + 398
    3   FBSDKLoginKit                       0x0000000107df490e -[FBSDKLoginManager logInParametersWithPermissions:serverConfiguration:] + 110
    4   FBSDKLoginKit                       0x0000000107df53d7 -[FBSDKLoginManager logInWithBehavior:] + 103
    5   FBSDKLoginKit                       0x0000000107df5157 -[FBSDKLoginManager logInWithPermissions:handler:] + 391
    6   FBSDKLoginKit                       0x0000000107df2deb -[FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:] + 395
    7   flutter_facebook_login <…>
Lost connection to device.`

Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>CFBundleIdentifier</key>
        <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>fbTestingApp</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>$(FLUTTER_BUILD_NAME)</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>$(FLUTTER_BUILD_NUMBER)</string>
        <key>LSRequiresIPhoneOS</key>
        <true />
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreen</string>
        <key>UIMainStoryboardFile</key>
        <string>Main</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <false />

        <!-- Facebook Login configuration -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>fb2443122242373229</string>
                </array>
            </dict>
        </array>
        <key>FacebookAppID</key>
        <string>2443122242373229</string>
        <key>FacebookDisplayName</key>
        <string>fbTestingApp</string>

        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fbapi</string>
            <string>fb-messenger-share-api</string>
            <string>fbauth2</string>
            <string>fbshareextension</string>
        </array>
        <!-- End of Facebook Login configuration -->

        <!-- Google Sign-in Section -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>com.googleusercontent.apps.572121212121-axxxxp6vaaaadc06aaaaaacd4d7lbnc</string>
                </array>
            </dict>
        </array>
        <!-- End of the Google Sign-in Section -->
    </dict>
</plist>

anyone faced similar problem ?!

Github Issue Link (https://github.com/roughike/flutter_facebook_login/issues/64)

like image 676
Saifallak Avatar asked Dec 03 '22 10:12

Saifallak


2 Answers

okay , it was a miss in pinfo file ,, it should be :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>CFBundleIdentifier</key>
        <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>fbTestingApp</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>$(FLUTTER_BUILD_NAME)</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>$(FLUTTER_BUILD_NUMBER)</string>
        <key>LSRequiresIPhoneOS</key>
        <true />
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreen</string>
        <key>UIMainStoryboardFile</key>
        <string>Main</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <false />

        <!-- FACEBOOK&GOOGLE CONFIG START HERE -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>fb2443122242373229</string>
                </array>
            </dict>

            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>com.googleusercontent.apps.572121212121-axxxxp6vaaaadc06aaaaaacd4d7lbnc</string>
                </array>
            </dict>
        </array>

        <key>FacebookAppID</key>

        <string>2443122242373229</string>
        <key>FacebookDisplayName</key>

        <string>fbTestingApp</string>

        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fbapi</string>
            <string>fb-messenger-share-api</string>
            <string>fbauth2</string>
            <string>fbshareextension</string>
        </array>
        <!-- FACEBOOK&GOOGLE CONFIG END HERE -->
    </dict>
</plist>

i found that "CFBundleURLTypes" is called twice and i should merge them

like image 143
Saifallak Avatar answered Dec 18 '22 16:12

Saifallak


I got this error because I had the plist entry as FacebookAppId, but needed FacebookAppID. Capitalize the last letter.

like image 20
J Duncan Avatar answered Dec 18 '22 16:12

J Duncan