Swipe News App

Setup Firebase


Setup Firebase

To set up Firebase for your Swipe News App, follow these steps:

1. Create Project in Firebase

  1. Go to the Firebase Console.
  2. Click on Add project.
  3. Enter the project name (e.g., Swipe News App).
  4. (Optional) Set up Google Analytics for your project by enabling or skipping this step.
  5. Click on Create project.

2. Enable Phone Authentication

  1. In your Firebase project, navigate to the Authentication section from the left sidebar.
  2. Click on the Sign-in method tab.
  3. Select Phone from the list of sign-in providers.
  4. Enable Phone sign-in and click Save.

3. Add SHA-1 Key

  1. In the Firebase Console, go to Project settings by clicking on the gear icon.
  2. Under the General tab, find the Your apps section.
  3. Click on your Android app to expand its settings.
  4. In the SHA certificate fingerprints section, click Add fingerprint.
  5. Enter your SHA-1 key. To get the SHA-1 key, run the following command in your terminal (replace keytool path if necessary):

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

  6. Copy the SHA-1 key from the output and paste it into the Firebase Console, then click Save.

4. Configure Firebase in Android Studio

  1. Open your Android project in Android Studio.
  2. In the Firebase Console, go to Project settings by clicking on the gear icon.
  3. Download the google-services.json file from the General tab.
  4. In Android Studio, switch to the Project view.
  5. Copy the google-services.json file and paste it into the app directory of your project.

By following these steps, you will successfully set up Firebase in your Swipe News App. This setup will enable phone authentication, allowing users to sign in using their phone numbers, and ensure proper configuration with the SHA-1 key.