Integrate notification for SDK - Android

Integrate notification for SDK - Android

1. Adding the Firebase Configuration File

  1. Download the google-services.json file:

  2. Add the google-services.json file to your project:

    • Place the google-services.json file in the app/ directory of your Android project.

  3. Add Firebase dependencies

    • Open your android/build.gradle file and add the following classpath in the dependencies section:

      classpath 'com.google.gms:google-services:4.3.15'
    • Apply the Google Services plugin

      apply plugin: 'com.google.gms.google-services'

2. Implementing Notification Handling in the host app (Fan App)

Check in the demo with classes, these classes support handling notifications for Android:

  • FirebaseMessageHelper

  • FirebaseMessageService 

  • NotificationTapReceiver

Please add service and permission to AndroidManifest.xml

3. TIXNGO SDK notification function  

  • TixngoManager.instance.updateFCMToken(token) => Using this function whenever received FCMToken from Firebase.

  • TixngoManager.instance.processFcmMessageIfNeed(notificationData) => Using this function when received notification from Firebase, the SDK will handle 

  • TixngoManager.instance.onRemoteFcmMessageIfNeed => Using this function when tap on notification from Firebase, the SDK will handle redirect to SDK UI

4. DEMO

© TIXNGO 2023 - Login