On this page

All pages






Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space TDDM and version 1

The Totara Mobile App uses the Firebase app uses Firebase Cloud Messaging (formerly known as Google Cloud Messaging) to deliver push notifications to registered devices. 

...

  1. Message building and targeting, in either the notification console GUI or a trusted environments environment such as Admin SDK.
  2. The topic or instance is then sent to the FCM backend.
  3. Next is platform-level message transport, where the notification goes through an Android transport layer, iOS/APNs or web push.
  4. This is then pushed to SDK on the device. 

Diagram of how Firebase Cloud Messaging works

Configuring Google Service for iOS

...

  1. Go to the Firebase console.

  2. In the center centre of the project overview page, click the iOS icon to launch the setup workflow.

    Screenshot of project overview page.
  3. If you've already added an app to your Firebase project, click Add app to display the platform options.
  4. Enter your app's bundle ID in the iOS bundle ID field .

    Make

    - make sure to enter the bundle ID that your app is actually using. The bundle ID value is case-sensitive, and it cannot be changed for this Firebase iOS app after it's registered with your Firebase project.

    • XCode Bundle IDImage Modified
    • Image Modified
  5. Optionally you can enter other app information:; App nickname and App Store ID.

  6. Click Register app.

...

  1. Go to the Firebase console.

  2. In the center centre of the project overview page, click the Android icon or Add app to launch the setup workflow.

  3. Enter your app's package name in the Android package name field .

    Make

    - make sure to enter the package name that your app is actually using. The package name value is case-sensitive, and it cannot be changed for this Firebase Android app after it's registered with your Firebase project.Gradle app idImage Modified

    Image Modified
  4. Optionally you can enter other app information:; App nickname and Debug signing certificate SHA-1.

  5. Click Register app.

...

Once you have done the configuration part, install and run the app on a device and you will a will see, in the debug logs, a massage that contains a statement "FCM TOKEN RECEIVED message " (if authenticated successfully):Image Removed.

This means FCM recognises you your app.

Testing a push notification 

If you have access to the FCM token, you can perform the simplest a simple test to make sure the communication between FCM and the device is correct:

...

If you receive your test notification, this means FCM is able to send to the device a push notification.

Alternatively, the same test can be done via Postman. You can use this example, just import it into the Postman tool. 

  • Replace the value of the property "to" with the testing device token
  • In the result panel, you will see if FMC was able to deliver the message to the device ("success": 1) or not to deliver the message to the device


If you are trying to send a push notification via a Totara instance, make sure the steps configuring Totara AirNotifier is done and working as expected.

...

  • In most cases, a missing configuration step is the root cause for not receiving a push notification message.
  • Use a physical device to perform push notification tests. There is no guarantee for delivering of messages on simulators/emulators.
  • Avoid sending unnecessary push unnecessary push notifications. If you send too many,  Apple Push Notification service the Apple Push Notification service (APNs) will throttle your will throttle your requests. 
  • The user must be logged into the app to get a valid token.
  • If you logout log out on the app, your token will be invalidated.

...

  • Verify if notifications permission is allowed on the device:
    1. Go to the Settings and find for the Totara app.


    2. Verify if notifications are allowed.


    3. Make sure you have allowed the Totara app to send you notifications when you first installed it.
      Image Modified


If you are extending/customising the Totara Mobile app

...

Verify if the Google service files are the correct ones and if they are at the correct place

...

.

iOS
The configuration (plist) must be at ios/GoogleService-Info.plist. Application IDs defined

...

in the info.plist (xcode project identity settings)

...

and GoogleService-Info.plist must match.
Image Modified
Image Modified

Android

The configuration (json) must be at android/app/google-services.json. Application IDs defined in the app/build.gradle and google-services.json must match
Image Modified
Image Modified

Also, make sure you are using the correct flavour when generating a release build. Mismatching application IDs will lead to the push notification message not being delivered.
Image Modified

  • If the configuration is done properly, you will be able to see the FCM token registering messages .
    Image Removedin the debug logs:
    • FCM TOKEN RECEIVED:   Means the This means the communication between FCM and the device is working properly, and FCM can find your device
    • REGISTERING FCM TOKEN: The token is being sent to the Totara instance backend to be linked to the current app user
    • TOKEN REGISTERED: The token has been linked to the current app user

  • If you are still not able to see the FCM token in the console, you can try a few things:
    • Uninstall the app manually
    • Close the react console
    • Execute the running command to launch a new instance of the app

...

Depending on the device the app is being tested on, you might face issues receiving push notification messages when the app is closed (killed, not in the background). Some manufactures manufacturers might kill the app service to save battery.

...