aChat – Flutter Firebase Chat and Messenger Documentation

  1. Home
  2. Docs
  3. aChat – Flutter Firebase Chat and Messenger Documentation
  4. Get Started

Get Started

A) How to run existing demo app?

Download the project by using the Zip Folder with the project files.

We recommend using the latest stable version of Android Studio and the Flutter plugin. Open pubspec.yaml and click on Packages get to download the latest libraries. Or if you want to run via terminal from the project folder: Run flutter pub get.

Open either an iPhone simulator or an Android emulator and make sure the app runs. Tap play button in Android Studio. Or you can run the app via terminal by following commands:

cd <project-directory>
flutter devices
flutter run

 

B) How to connect and change firebase backend account?

1. Creating your own Firebase Account

This instruction shows you how to integrate your own firebase to A Chat app template.

In order to have a Firestore database, you need a Firebase account. Go to https://firebase.google.com/ and sign up for an account.

On the Welcome to Firebase page, click the Create Project button.

create a new project firebase

Now, enter the project name: <Your project name>. Select the terms checkbox and press the Continue button.

On the next page, click on the switch to disable Analytics as you won’t use it. Then, click Create Project.

You’ll see a few progress dialogs:

Once your new project is ready, press Continue to get to the Getting Started page:

Here you can add Firebase to both your iOS and Android apps. Start with the iOS app.

2. Registering an iOS App

To register the iOS app, click on the iOS circle:

You’ll see a dialog to register your app. Enter net.uikitty.achat for the iOS bundle id and click on the Register App button.

Next, click the Download GoogleService-Info.plist button.

Now, move this file into the iOS ‣ Runner folder. Then, from Android Studio in the Tools ‣ Flutter menu, choose Open iOS module in Xcode. In Xcode, right-click the Runner folder and choose Add files to Runnner….

Next, add GoogleService-Info.plist:

IOS is done. Next, register the Android app.

3. Registering an Android App

First, go back to the Firebase page. On the main page click the Android circle to start the process of adding Firebase to Android:

You’ll see a dialog to register your app. Enter net.uikitty.achat in the Android package name. Next, click Register App:

Then, click the Download google-services.json button. In the Finder, move this file into the android ‣ app folder.

Android is done.

4. Enable Authentication by email

  1. First, go to the Authentication,
  2. Choose tab sign-in method
  3. Click on email/password status disable
  4. Click Enable and Save

auth enable documentation achat

 

5. Creating Firestore Database

  1. On the Firebase console choose the Database option under the Develop menu. Now click the Create Database button and choose Start in production mode.  create databse firebase 1
  2. Choose production mode and click next:
    database production mode 2
  3. Click Done on the next step:
    create database firebase 3
  4. Go to database link (1) after going to tab rules (2) after paste permission code bellow to the field and click publish:
    rules_version = '2';
    service cloud.firestore {
      match /databases/{database}/documents {
        match /{document=**} {
          allow read, write: if request.auth.uid != null;
        }
      }
    }
    

    edit permissions rules 44

 

Was this article helpful to you? Yes No

How can we help?

2 Responses

  1. I was curious because we bought the app, then when we follow these steps, it is still connected to the previous backend. Please help to advise how to fix this issue.

Leave a Reply

Your email address will not be published. Required fields are marked *