Git Product home page Git Product logo

Comments (11)

pr-Mais avatar pr-Mais commented on June 24, 2024 3

Phone authentication is on-progress, follow it on this PR #40, it might take a while to make it to the published package, but feel free to try the current implementation and give any feedback:

dependencies:
  firebase_auth: ^3.3.1
  firebase_auth_desktop: ^0.1.1-dev.3
  firebase_core: ^1.9.0
  firebase_core_desktop: ^0.1.1-dev.3

dependency_overrides:
  firebase_auth_dart:
    git:
      url: https://github.com/invertase/flutterfire_desktop.git
      ref: phone-auth
  firebase_auth_desktop:
    git:
      url: https://github.com/invertase/flutterfire_desktop.git
      ref: phone-auth

from flutterfire_desktop.

cosmo83 avatar cosmo83 commented on June 24, 2024

Getting the following error, when building..

/C:/flutter/.pub-cache/git/flutterfire_desktop-da0ce79edb6539467d4eb51b4a834b10bc42be12/packages/firebase_auth/firebase_auth_desktop/lib/firebase_auth_desktop.dart(355,7): error GC6690633: No named parameter with the name 'verificationFailed'. [C:\Users\Phani Arava\Documents\FlutterProjects\agritrust\build\windows\flutter\flutter_assemble.vcxproj]
/C:/flutter/.pub-cache/git/flutterfire_desktop-da0ce79edb6539467d4eb51b4a834b10bc42be12/packages/firebase_auth/firebase_auth_desktop/lib/src/utils/type_mapper.dart(25,22): error GC9768DF9: Undefined name 'PhoneAuthProvider'. [C:\Users\Phani Arava\Documents\FlutterProjects\agritrust\build\windows\flutter\flutter_assemble.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(242,5): error MSB8066: Custom build for 'C:\Users\Phani Arava\Documents\FlutterProjects\agritrust\build\windows\CMakeFiles\f2a48561178365f1e8c6ff36dd92c21a\flutter_windows.dll.rule;C:\Users\Phani Arava\Documents\FlutterProjects\agritrust\build\windows\CMakeFiles\656dd05b9aa016d7956a93870ea49c9d\flutter_assemble.rule' exited with code 1. [C:\Users\Phani Arava\Documents\FlutterProjects\agritrust\build\windows\flutter\flutter_assemble.vcxproj]

from flutterfire_desktop.

pr-Mais avatar pr-Mais commented on June 24, 2024

Did you run flutter clean & flutter pub get?

from flutterfire_desktop.

cosmo83 avatar cosmo83 commented on June 24, 2024

Did you run flutter clean & flutter pub get?

Yes ...

from flutterfire_desktop.

pr-Mais avatar pr-Mais commented on June 24, 2024

@cosmo83 did you get it to run on Windows? I couldn't reproduce the error you got, it compiled on Windows with no issues.

from flutterfire_desktop.

cosmo83 avatar cosmo83 commented on June 24, 2024

Using Windows 10 .. Here is my flutter doctor -v and pubspec dependencies

[√] Flutter (Channel master, 2.9.0-1.0.pre.292, on Microsoft Windows [Version 10.0.19042.1466], locale en-IN)
• Flutter version 2.9.0-1.0.pre.292 at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a2ecde6daa (2 weeks ago), 2022-01-08 20:55:09 -0500
• Engine revision 9327c029ae
• Dart version 2.16.0 (build 2.16.0-144.0.dev)
• DevTools version 2.9.2
• PATH = C:\Program Files (x86)\Common
Files\Oracle\Java\javapath;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\OpenSSH\ ;C:\Program Files\PuTTY;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Calibre2;C:\Program Files\Kubernetes\Minikube;C:\flutter\bin;C:\Program
Files (x86)\IncrediBuild;C:\Program Files\Git\cmd;C:\Users\Phani Arava\AppData\Local\Microsoft\WindowsApps;C:\Users\Phani
Arava\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Phani Arava\AppData\Roaming\npm;C:\Program Files\JetBrains\PyCharm Community Edition
2021.2.2\bin;;C:\flutter\bin;C:\Users\Phani Arava\AppData\Local\Pub\Cache\bin;C:\Users\Phani
Arava\AppData\Local\Android\Sdk\platform-tools;;C:\flutter\bin\mingit\cmd

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\Phani Arava\AppData\Local\Android\sdk
• Platform android-31, build-tools 32.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.0.32014.148
• Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• 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 11.0.10+0-b96-7249189)

[√] VS Code (version 1.63.2)
• VS Code at C:\Users\Phani Arava\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.32.0

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.1466]
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99
• Edge (web) • edge • web-javascript • Microsoft Edge 97.0.1072.55

[√] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

Dependencies specify other packages that your package needs in order to work.

To automatically upgrade your package dependencies to the latest versions

consider running flutter pub upgrade --major-versions. Alternatively,

dependencies can be manually updated by changing the version numbers below to

the latest version available on pub.dev. To see which dependencies have newer

versions available, run flutter pub outdated.

dependencies:
flutter:
sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^1.0.2
firebase_core: ^1.10.6
firebase_auth: ^3.3.4
sms_autofill: ^2.2.0
settings_ui: ^1.0.0
http: ^0.13.4
flutter_dotenv: ^5.0.2
firebase_crashlytics: ^2.4.4
pin_code_fields: ^7.3.0
intl_phone_number_input: ^0.7.0+2
libphonenumber_web: ^0.2.0+1
google_ml_kit: ^0.7.3
image_picker: ^0.8.4+4
xml2json: ^5.3.2
firebase_core_desktop: ^0.1.1-dev.3
firebase_auth_desktop:
git:
url: https://github.com/invertase/flutterfire_desktop.git
path: packages/firebase_auth/firebase_auth_desktop
ref: phone-auth
socket_io_client: ^2.0.0-beta.4-nullsafety.0
wave: ^0.2.0
pdf: ^3.6.5

from flutterfire_desktop.

pr-Mais avatar pr-Mais commented on June 24, 2024

I see the issue.
Since the desktop package is using firebase_auth_dart, you have also to override it or it will use the version on pub which doesn't contain any of the phone auth methods. So please add the following to your pubspec:

dependencies:
  firebase_auth: ^3.3.1
  firebase_auth_desktop: ^0.1.1-dev.3
  firebase_core: ^1.9.0
  firebase_core_desktop: ^0.1.1-dev.3

dependency_overrides:
  firebase_auth_dart:
    git:
      url: https://github.com/invertase/flutterfire_desktop.git
      ref: phone-auth
  firebase_auth_desktop:
    git:
      url: https://github.com/invertase/flutterfire_desktop.git
      ref: phone-auth

from flutterfire_desktop.

cosmo83 avatar cosmo83 commented on June 24, 2024

Now iam getting this error.

[firebase_auth_dart] Unsupported operation: This credential is not supported yet.

`PhoneAuthCredential credential = PhoneAuthProvider.credential(verificationId: this.verificationId!, smsCode: smscode!);
try{
print("Signing In With Credentials");
await auth.signInWithCredential(credential);
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) => MainScreen()));
} on FirebaseAuthException catch (e) {
if (e.code == 'invalid-verification-code') {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Wrong SMS Code. Please Re-Enter')));
textEditingController.clear();
setState(() {
smscode = '';
});

              }
            }catch (e) {
               print(e);
            }`

from flutterfire_desktop.

pr-Mais avatar pr-Mais commented on June 24, 2024

That's because Phone Auth on Desktop has a similar experience to Web, the README will be updated soon, meanwhile please check the example app here.

from flutterfire_desktop.

cosmo83 avatar cosmo83 commented on June 24, 2024

Now, things are working fine. Any plan to move the captcha into the desktop window instead of opening a browser tab ?

from flutterfire_desktop.

pr-Mais avatar pr-Mais commented on June 24, 2024

Great to hear, please let us know if you have any feedback or you faced any bugs, that'll be super helpful!
Regarding captcha, there're plans to use a webview but we still need to explore the best way to do it.

from flutterfire_desktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.