How to setup Firebase Emulator in Flutter in 5 minutes

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • This video goes over the setup to use the firebase emulator with a flutter application.
    Written:

Комментарии • 41

  • @mars3142
    @mars3142 3 года назад +11

    You shouldn't allow cleartext traffic in the release build (see 3:12). So it would be better to only allow it for the debug build with a separate manifest in src/debug/AndroidManifest.xml.

    • @FilledStacks
      @FilledStacks  3 года назад +2

      Good point. I will pin this comment so other devs also know. Thanks for leaving a comment.

    • @uobislrt
      @uobislrt 3 года назад

      Hi @peter, could you show what the src/debug/AndroidManifest.xml would look like when adding in the config to allow clear text transport only in debug config?

  • @aymennurhussen3689
    @aymennurhussen3689 3 года назад +3

    i think I’m the inspiration for this short but effective tutorial 😁.👌👌👌

    • @FilledStacks
      @FilledStacks  3 года назад +1

      Haha, it was the only one I could fit in. Schedule has been so hectic lately with all the projects we're doing.

  • @rsa_doluse7962
    @rsa_doluse7962 3 года назад

    Awesome, straightforward tutorial. Thanks

  • @marshal_moses7256
    @marshal_moses7256 Год назад

    very easy to follow tutorial

    • @FilledStacks
      @FilledStacks  Год назад

      I'm happy to hear that, 2 years later and it's still useful 😊

  • @sadhlife
    @sadhlife 3 года назад +1

    If you're using an actual device connected by ADB, you can use localhost, but you'll also have to use the `adb reverse` command to forward the PC's localhost to the phone.

    • @FilledStacks
      @FilledStacks  3 года назад

      Nice, I didn't know that. Thanks for leaving the comment. I'm sure it'll help some other devs as well.

  • @william_chidube
    @william_chidube 3 года назад

    Splendid. As always.

    • @FilledStacks
      @FilledStacks  3 года назад +1

      Thank you :) Much appreciated William.

  • @javeedishaq7643
    @javeedishaq7643 3 года назад +1

    Awesome

    • @FilledStacks
      @FilledStacks  3 года назад

      Thank you 😊 and thanks for leaving a comment.

  • @isaacadariku
    @isaacadariku 3 года назад

    Awesome 💪Thanks 😊

    • @FilledStacks
      @FilledStacks  3 года назад

      It's my pleasure to keep sharing ;)

  • @VishalYadav-vo7fc
    @VishalYadav-vo7fc 3 года назад

    Great videos , the only problem is that we have to wait for 1-2 weeks for more videos ..

    • @FilledStacks
      @FilledStacks  3 года назад +1

      That is an issue I would probably also feel if I was following a series.
      And in that there's some videos that won't be code related but more planning related, like the next one coming out.

  • @carlomigueldy
    @carlomigueldy 3 года назад

    🔥🔥🔥🔥🔥

  • @chomanthapa
    @chomanthapa 3 года назад

    Thank you so much, I have two quick questions. If I were initializing handlers like firebasemessagingBackgroundHandler before the main method then will your steps work? Second How can I use firebase functions and not just firestore ? The emulators for it already set up

    • @FilledStacks
      @FilledStacks  3 года назад

      Thanks for leaving a comment! And thanks for watching.
      1. No cloud messaging on emulator that I know of that works. So it'll still work but will come from the real firebase instance.
      2. The same way as I did in here. The functions package has a way to set the emulator. Just look at your port number in the logs when starting the emulator and use that one for your cloud functions setup.

    • @chomanthapa
      @chomanthapa 3 года назад

      @@FilledStacks Can you help me with how to connect a real physical device to localhost instead of an emulator? The emulator works fine just need to use the real physical device as my authentication takes a image argument too.

    • @FilledStacks
      @FilledStacks  3 года назад +1

      Yep. Watch the last minute or so of my firebase emulator video.

    • @chomanthapa
      @chomanthapa 3 года назад

      @@FilledStacks yup followed everything. I'll try with another device. Thank you so far! Great tutorial

    • @sadhlife
      @sadhlife 3 года назад

      @@chomanthapa try using adb reverse command to forward your PC's localhost to your phone. If your app is running on localhost:5000, you can run
      adb reverse tcp:5000 tcp:5000

  • @whoman7930
    @whoman7930 3 года назад

    4:00 you said, we need the IP address. But you hvnt used it anywhere later in the video? So what's the point?

    • @FilledStacks
      @FilledStacks  3 года назад +1

      I use 0.0.0.0 instead of my actual IP address. We use it go change the host of firebase emulators and to connect to in the connect firebase emulators function in main. We literally used it everywhere it's needed :)

  • @JoshuaGrippo
    @JoshuaGrippo 2 года назад

    Thanks for the tutorial. Does anyone know if the flutterfire_ui will work with the emulator? I am trying to use the signin screen with google, but when i click the button it does nothing. Nothing in the log, just makes the screen flicker.
    SignInScreen(
    showAuthActionSwitch: false,
    providerConfigs: [
    GoogleProviderConfiguration(
    clientId: DefaultFirebaseOptions.currentPlatform.appId,
    ),
    ],
    )

    • @FilledStacks
      @FilledStacks  2 года назад +1

      You're very welcome. I haven't used the flutterfire_ui before but it should work. Check that you're using the useEmulator function and not the settings option when pointing to the emulator.

  • @wheatonrecurrence9525
    @wheatonrecurrence9525 3 года назад

    Is anyone else having trouble linking the realtime database emulator to flutter app?

    • @FilledStacks
      @FilledStacks  3 года назад

      I haven't seen any other comments about it. Are you using the url printed out by the emulator?

    • @wheatonrecurrence9525
      @wheatonrecurrence9525 3 года назад

      ​@@FilledStacks not too sure. Let me look at that. Thanks.

  • @noahderebe
    @noahderebe 2 года назад +2

    2:04 useEmulator is deprecated. Instead use await FirebaseAuth.instance.useAuthEmulator('$localHostString',9099);