Integrate notification for SDK - Android
1. Adding the Firebase Configuration File
Download the
google-services.json
file:Add the
google-services.json
file to your project:Place the
google-services.json
file in theapp/
directory of your Android project.
Add Firebase dependencies
Open your
android/build.gradle
file and add the following classpath in thedependencies
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
You can check notification demo on https://github.com/tixngo-mobile-github/tixngoAndroidDemo/tree/demo_v1.0.8
© TIXNGO 2023 - Login