Netmera Developer Guide
Netmera Docs
  • Netmera Developer Guide
  • Platforms
    • iOS
      • New iOS (Swift)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Widget and In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Advertising ID
        • Changelog
      • Former iOS (Objective-C)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Push Payload Receivers
          • Widget and In-App Messages
          • Customizing In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
          • Custom Web View Presentation
          • Push Icon
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Data Transfer
        • Advertising ID
        • SSL Pinning
        • Changelog
    • Android
      • SDK Integration
        • Huawei Integration
        • Huawei Message Receipt
        • Custom FCM and HMS Implementations
        • Android Integration FAQs
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
        • Custom Web View Presentation
        • Push Icon
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
        • Background Location Permission
      • User & Attributes
      • Data Transfer
      • Advertising ID
      • App Tracking
      • SSL Pinning
      • Changelog
    • Web
      • SDK Setup
        • Self-Hosted SDK Setup
      • Mobile Web Push for iOS
      • Deep Linking
        • Custom Deep Links
      • Events
      • User & Attributes
    • React Native
      • SDK Integration
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • Changelog
    • Flutter
      • SDK Integration
        • Custom FCM and HMS Implementations
      • Push Notifications
        • Push Notification Permissions
        • Widget and In-App Messages
        • Flutter iOS Media Push
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • SSL Pinning
      • Changelog
    • Cordova
      • SDK Integration
      • Push Notifications
      • Sound & Vibration
      • Push Inbox
      • Events
      • User & Attributes
    • Unity
      • SDK Integration
      • Sound & Vibration
      • Events
      • User & Attributes
      • Changelog
  • Integrated Modules
    • Optimove
    • Adjust
    • Mixpanel
    • IYS Integration
    • VIA Integration
      • Short URL Consent Requests
      • OTP Consent Requests
        • OTP Confirmation Completion
      • VIA Email Rejection Link Generation
      • ETK Rejection via SMS
  • API Documentation
    • REST API
      • Setup
      • Notifications
      • Events
      • User & Device Management
      • Inbox Feature
      • GDPR
      • Error Responses
  • FAQs
    • Push Notifications FAQs
Powered by GitBook
On this page
  • Step 1. Manifest Configuration
  • Step 2. FCM and HMS Implementations

Was this helpful?

  1. Platforms
  2. Android
  3. SDK Integration

Custom FCM and HMS Implementations

If your platform uses a custom FirebaseMessagingService or HmsMessageService, you need to update your AndroidManifest.xml file to avoid service conflicts with Netmera.

Step 1. Manifest Configuration

For Custom FirebaseMessagingService:

If you are using your own FirebaseMessagingService class, make sure to add the following line to your AndroidManifest.xml to remove Netmera's default FCM service:

<service
    android:name="com.netmera.nmfcm.NMFirebaseService"
    tools:node="remove" />

For Custom HmsMessageService:

If you are using your own HmsMessageService class, include the following entry in your manifest to remove Netmera’s default HMS service:

<service
    android:name="com.netmera.nmhms.NMHuaweiService"
    tools:node="remove" />

Step 2. FCM and HMS Implementations

For Custom FirebaseCloudMesssaging (FCM)

// For FirebaseCloudMesssaging (FCM)
override fun onMessageReceived(remoteMessage: RemoteMessage) {
    super.onMessageReceived(remoteMessage)

    if (Netmera.isNetmeraRemoteMessage(remoteMessage.data)) {
        Netmera.onNetmeraPushMessageReceived(remoteMessage)
    } else {
        // Handle other messages
    }
}

For Custom HmsMessageService (HMS):

// For Custom HmsMessageService (HMS)
override fun onMessageReceived(remoteMessage: RemoteMessage) {
    super.onMessageReceived(remoteMessage)

    if (Netmera.isNetmeraRemoteMessage(remoteMessage.dataOfMap)) {
        Netmera.onNetmeraPushMessageReceived(remoteMessage)
    } else {
        // Handle other messages
    }
}

Deprecated Methods before v4.0.12

Starting from Netmera SDK version 4.0.12, the method:

Netmera.isNetmeraRemoteMessage(remoteMessage)

has been deprecated. Please update your implementation as shown in title 2.

PreviousHuawei Message ReceiptNextAndroid Integration FAQs

Last updated 21 days ago

Was this helpful?