Skip to content

Latest commit

 

History

History

README.md

For more information, visit firebase.google.com.

Original Firebase Github Repository

https://github.com/firebase/friendlychat

Create Firebase console Project

  1. Go to the Firebase console.
  2. Create a New Project.
  3. Connect your Android App.
  4. Add google-services.json file to your app.
  5. Add google-services plugin to your app.
  6. Sync your project with gradle files.

Authentication

** Enable Authentication - Firebase console**

  • Enable Google as a sign-in provider from the Firebase console > Authentication.
  • Set rules on the database from the Firebase console > Database > Rules like:
{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

Messages

** Import Messages **

  1. Go to the Firebase console > Database.
  2. Select Import JSON from the overflow menu of the Database.
  3. Import the initial_messages.json file.

** Test message sync **

  1. From the Firebase console > Database > DATA tab, select the + sign on the messages element.
  2. Give the new element a name of -ABCD (note the '-' sign).
  3. Select the + sign on the -ABCD element.
  4. Give the new element a name of name and value of your name.
  5. Select the + sign on the -ABCD element.
  6. Give the new element a name of text and value of Hello, World!.
  7. Select Add.

On-device App Indexing

** Test On-device App Indexing **

  1. Start up the FriendlyChat app and send a new message with the text Hi world!
  2. Go to the Google app, switch to In Apps and search for Hi world.
  3. Confirm that the message can be found in the Google app.
  4. Tap on the result and confirm the FriendlyChat app opens.

Notifications

** Test Background Notifications **

  1. Run the updated application.
  2. Hit the device's home button (or otherwise send the app to the background).
  3. In Firebase console select Notifications from the left navigation bar.
  4. Set Message Text to "Friendly Chat?".
  5. Select the app we connected earlier as the App target.
  6. Click Send Message
  7. Confirm that message is received and notification is displayed on the device. The user should receive a notification that takes them back to the application when tapped.

Remote Config

** Test Remote Config **

  1. Go to Firebase console > Remote Config.
  2. Click on Add Parameter.
  3. Set the Parameter key to friendly_msg_length and the Parameter value to 20.
  4. Click Publish Changes when you're done.

App Invite

** Test App Invite **

  1. Run the application.
  2. Tap the menu overflow at the top right of the screen.
  3. Select the Invite option.
  4. You should see the App Invites interface which will allow you to select Email and SMS contacts and send a custom invitation. You must have control of the receiving account to view the invitation once sent.
  5. Tap send and verify that the invitation is sent to the selected contact.
  6. Verify that selected contact is taken to app install screen from invite.

Crash Reporting

** Test Firebase Crash **

  1. Run the application.
  2. Verify that the Cause Crash menu item is available from the overflow menu.
  3. Verify that when Cause Crash is selected the application crashes.
  4. From the logcat verify that the crash report was successfully uploaded. If you do not see logs indicating that the crash report was sent, make sure that the Android Studio logcat filter is set to No Filters.

Test the App (in the cloud!)

Check more in codelabs.developers.google.com.