package com.example.test_sa;

import android.util.Log;

import com.huawei.hms.push.HmsMessageService;
import com.huawei.hms.push.RemoteMessage;

public class HService extends HmsMessageService {

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        super.onMessageReceived(remoteMessage);

        if (remoteMessage != null) {
            System.out.println("remote:"+remoteMessage.getData());
            if (!remoteMessage.getData().isEmpty()) {
                Log.d("HMS", "Payload" + remoteMessage.getData());
            }

            if (remoteMessage.getNotification() != null) {
                Log.d("HMS", "Message Notification Body: " + remoteMessage.getNotification().getBody());
            }
        }
    }
}