firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.71k stars 3.97k forks source link

[Auth]: when it complies with iOS device, phone auth makes some error #13332

Closed hajini closed 1 month ago

hajini commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

Flutter, when I compile my project with iOS device, if i try to do phone number verification, when it converts to verification screen (choose cycle or bus.. like this), it makes this error.

I'm use this package with edited code but, whenever I update pod, it is returned to basic code.

plz, fix this bug.

Below is the result of 'flutter doctor -v'.

[✓] Flutter (Channel stable, 3.24.2, on macOS 14.6.1 23G93 darwin-arm64, locale ko-KR) • Flutter version 3.24.2 on channel stable at • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4cf269e36d (10 days ago), 2024-09-03 14:30:00 -0700 • Engine revision a6bd3f1de1 • Dart version 3.5.2 • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.93.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.96.0

[✓] Connected device (4 available)

[✓] Network resources • All expected network resources are available.

• No issues found!

Reproducing the issue

It's error code.

class AuthAPNSTokenManager

func getToken() async throws -> AuthAPNSToken { return try await withCheckedThrowingContinuation { continuation in self.getTokenInternal { token, error in if let token = token { continuation.resume(returning: token) } else if let error = error { continuation.resume(throwing: error!) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here } } } }

Below is my temp code for using this package. but I need your official support.

func getToken() async throws -> AuthAPNSToken { return try await withCheckedThrowingContinuation { continuation in self.getTokenInternal { token, error in if let token = token { continuation.resume(returning: token) } else if let error = error { continuation.resume(throwing: error) } else { continuation.resume(throwing: NSError(domain: "YourDomain", code: 1, userInfo: [NSLocalizedDescriptionKey: "Unknown error occurred"])) } } } }

Firebase Core version

3.4.0

Flutter Version

3.24.2

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```

Additional context and comments

No response

CntrlX commented 1 month ago

i have an error in the same spot,FirebaseAuth/AuthAPNSTokenManager.swift:82: Fatal error: Unexpectedly found nil while unwrapping an Optional value

SelaseKay commented 1 month ago

Hi @hajini , this issue already exists. 13255

arsarsars1 commented 1 month ago

Hi, has anyone found the solution? @SelaseKay @hajini