1. Home
  2. Docs
  3. Listar App
  4. Admin Backend
  5. Notifications
  6. Firebase Settings

Firebase Settings

Firebase Cloud Messaging, formerly known as Google Cloud Messaging, is a cross-platform cloud service for messages and notifications for Android, iOS, and web applications.

The user will get notification related with booking, claim listing, payment & submit listing.

The setting requires 2 steps

  • App Settings
  • Backend Settings

App Settings

iOS Settings

Go to the URL https://console.firebase.google.com. Select → Create a project

Create a project

Project Overview → Select the iOS

Register your iOS app with Firebase.
  • iOS bundle ID: bundle ID is taken from your application. Refer./source/ios/Runner.xcodeproj/project.pbxprojPRODUCT_BUNDLE_IDENTIFIER
  • App nickname: It is an optional value. This name will be used for presence in the Firebase console.
  • App Store ID: It is an optional value. Skip if app is not yet registered

Confirm by the button → Register App

Add Firebase to your IOS app

Click on the Download GoogleService-info.plist button to download the file then copy it to the ios directory of your project ./source/ios/Runner/GoogleService-info.plist .

If the GoogleService-info.plist file already exists, delete the old file and copy the new file.

Download config file for iOS
GoogleService-info.plist for iOS

Navigate to your Firebase console to enable push notifications on iOS with Cloud Messaging.

Project Overview → Project Settings → Cloud Messaging tab

Cloud Messaging to allow push notifications on iOS

You must have an Apple developer account to set up the APN authentication Key. Visit page https://developer.apple.com and select your account

Certificates, IDs & Profiles
Select for creating Keys
Setup & input require information
Confirm set up new Key
Download APNs Authentication Key for uses
Select for upload APNs Authentication Key
Select for upload the APNs Authentication Key from your local computer
Upload the APN authentication Key to Firebase console successfully

Install the push notification on the source code. Please use the Xcode application and open your source code ./source/ios/Runner.xcworkspace then will see the GoogleService-info.plist

Xcode – GoogleService-info.plist

Make sure the push notification has been enabled from your application. Please select Runner → Signing & Capabilities tab and make sure Background Modes options has been checked.

  • Background fetch
  • Remote notifications
Runner > Signing & Capabilities > Background Modes

Add Capability Push Notifications

From the Xcode application select tab Capability, in there you can double click for open the modal add new Capability and select Access Wifi Information.

Capability → Push Notifications

Navigate to your project folder and run the command

flutter clean
flutter run

Android Settings

Access the URL https://console.firebase.google.com. Select Project Overview → Android

Enroll the Android application ID

Define information

  • Android package name:  ./source/android/app/src/main/AndroidManifest.xml
  • App nickname: It is an optional value. This name will be used for presence in the Firebase console.
Select the package name of the application
Add Firebase to your Android app

Click on the google-services.json button to download the file then copy it to the Android directory of your project ./source/android/app/google-services.json . If the google-services.json file already exists, delete the old file and copy the new file.

Download the config file & select the Next button to complete add Firebase to your Android app.

Download the config file for Android
google-services.json for Android

Run command

flutter clean
flutter run

Backend Settings

Apps using the deprecated FCM legacy APIs for HTTP and XMPP should migrate to the HTTP v1 API at the earliest opportunity. Sending messages (including upstream messages) with those APIs was deprecated on June 20, 2023, and shutdown begins on July 22, 2024.

This docs is updated from 08-Sep-2024, since version plugin Listar Directory Listing version 1.0.34

Project ID

Access Firebase project https://console.firebase.google.com/ & find your project ID

Settings → Notification → General → Firebase Project ID

Firebase Private Key

Access Firebase project https://console.firebase.google.com/

  1. In the Firebase console, open Settings → Service Accounts.
  2. Click Generate new private Key.
  3. Download the private key in JSON format file.

Upload the JSON config file to your hosting & settings → file wp-config.php

define( 'LISTAR_FIREBASE_HTTP_V1_KEY', ‘/path/to/your/firebase-private-key.json');

Uploaded on the server & set permission

chmod 0755 /path/to/your/firebase-private-key.json
chown nginx:nginx /path/to/your/firebase-private-key.json

The unix nginx that use for run php script. It could be nobody, www-data … base on your system defined.

Setting file wp-config.php

define( 'LISTAR_FIREBASE_HTTP_V1_KEY', '/path/to/your/firebase-private-key.json');

Install Google Client

The Google Firebase need to install the SDKs and client libraries for send the push message.

https://firebase.google.com/docs/firestore/client/libraries#php

Install Composer

Refer docs https://getcomposer.org/doc/00-intro.md

Verify the composer has installed

composer --version
Composer version 2.1.8

Install Google Client

cd /path/to/your/site/wp-content/plugins/listar-directory-listing 
composer update