Home > Blockchain >  How to judge the remoteMessage type
How to judge the remoteMessage type

Time:10-08

I want to know the remoteMessage from HmsMessageService is a message data with or without notification, how to judge the difference between them?

public class HmsService extends HmsMessageService {

  @Override
  public void onMessageReceived(RemoteMessage remoteMessage) {
    // Judge if with or without notification.
  }
}

CodePudding user response:

Push Kit can process messages based on the destination app's status (running in the foreground or background). If you want the app running in the foreground to receive notification messages or data messages, you need to implement the onMessageReceived method. The app will take subsequent actions after receiving the messages.

For more details, you could refer to this Docs. Feel free to contact us if you have any further questions.

  • Related