Closed giovannilima262 closed 2 years ago
@giovannilima262 add your AppDelegate.swift and your Info.plist
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>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>pt</string>
</array>
<key>CFBundleName</key>
<string>[NAME]</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>[USER-CONTENT]</string>
<string>[NAME-APP]</string>
</array>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb[CODE]</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>dynamiclinks1</string>
<key>CFBundleURLSchemes</key>
<array>
<string>[URL]</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FacebookAppID</key>
<string>[CODE]</string>
<key>FacebookClientToken</key>
<string>[CODE]</string>
<key>FacebookDisplayName</key>
<string>[NAME]</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram-stories</string>
<string>instagram</string>
<string>facebook-stories</string>
<string>facebook</string>
<string>whatsapp</string>
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbapi20160328</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>fb-messenger-share-api</string>
<string>itms</string>
<string>twitter</string>
<string>tg</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>FacebookAutoLogAppEventsEnabled</key>
<true/>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<true/>
<key>NSCalendarsUsageDescription</key>
<string>[NAME] App needs access to the calendar in order to schedule a meditation reminder for you.</string>
<key>NSCameraUsageDescription</key>
<string>[NAME] App needs access to the camera in order for you to take a photo to upload.</string>
<key>NSHealthShareUsageDescription</key>
<string>[NAME] App would like to store the time you spend meditating to your Health app.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>[NAME] App would like to store the time you spend meditating to your Health app.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>[NAME] App needs access to the photo library in order for you to choose a photo to upload.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>[NAME] App needs access to the photo library.</string>
<key>NSUserTrackingUsageDescription</key>
<string>[NAME] App would like to track the effectiveness of online marketing campaigns across traffic sources.</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>remote-notification</string>
</array>
<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/>
<key>branch_universal_link_domains</key>
<array>
<string>[NAME].app.link</string>
<string>[NAME]-alternate.app.link</string>
<string>[NAME].test-app.link</string>
<string>[NAME]-alternate.test-app.link</string>
</array>
<key>branch_key</key>
<string>[CODE-BRANCH-KEY]</string>
<key>UIStatusBarHidden</key>
<true/>
<key>NSRemindersUsageDescription</key>
<string>The app doesn't require access to your reminders.</string>
<key>NSContactsUsageDescription</key>
<string>The app doesn't require access to your contacts.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The app doesn't require access to the microphone.</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>The app doesn't require access to speech recognition.</string>
<key>NSLocationUsageDescription</key>
<string>The app doesn't require access to your location.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>The app doesn't require access to your location.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>The app doesn't require access to your location.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>The app doesn't require access to your location.</string>
<key>NSAppleMusicUsageDescription</key>
<string>The app doesn't require access to the media library.</string>
<key>kTCCServiceMediaLibrary</key>
<string>The app doesn't require access to the media library.</string>
<key>NSMotionUsageDescription</key>
<string>The app doesn't require access to motion sensors.</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
AppDelegate.swift
import UIKit
import Flutter
import HealthKit
import Intents
import WidgetKit
import SwiftUI
import FBSDKCoreKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
let flutterViewController = self.window.rootViewController as! FlutterViewController
var flutter_native_splash = 1
UIApplication.shared.isStatusBarHidden = false
GeneratedPluginRegistrant.register(with: self)
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
print(url.absoluteURL.description)
return true
}
override func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return true
}
}
@giovannilima262 the problem is your AppDelegate.swift you are overriding some methods used by this plugin to redirect after facebook login
You should remove
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
print(url.absoluteURL.description)
return true
}
override func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return true
}
check https://github.com/darwin-morocho/flutter-facebook-auth/issues/261#issuecomment-1177246811
Thanks, it worked for me
What version are you using?
4.4.0
What OS and version are you using to local deploy your application?
macOS 14.4
What platforms are you seeing the problem on?
iOS
pubspec.yaml
Describe the Bug
... fbLoginResult ??= await _facebookLogin.logIn( permissions: [FacebookPermission.email], ); ...
Current state: When calling the login function facebook, the modal opens normally and when going through the authentication screens I am redirected to the first facebook screen and nothing else happens.
Expected Behavior
After the last authentication confirmation option, be returned to the app with a successful authentication.
To Reproduce
Uploading RPReplay_Final1657213222.mov…
Relevant log output
No response
flutter doctor -v