1

Here we integrate clevertap sdk as below, somehow HMS push kit msg is not received:

<service
   android:name="com.panda.demo.HmsPushService"
   android:exported="false">
   <intent-filter>
       <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
   </intent-filter>
</service>

implementation 'com.clevertap.android:clevertap-android-sdk:3.8.2'


public class HmsPushService extends HmsMessageService {

    private static final String TAG = "pushdemo";
    @Override
    public void onNewToken(String token) {
        super.onNewToken(token);
        Log.i(TAG, "receive token:" + token);

    }
ychen9
  • 15
  • 4

1 Answers1

0

You have to integrate CleverTap SDK for Huawei as mentioned here.

For latest Push Kit versions, please refer to Huawei Push Kit documentation here:

  1. Library version is wrong, 'com.clevertap.android:clevertap-android-sdk:4.0.0' , check here

  2. Remove "service" from manifest, you will receive msg

    a. If you choose to have the "service" , the HmsPushService Class can not be empty like this. It should have at least more code like the sample in github: onMessageReceived() which call
    CleverTapAPI.createNotification(getApplicationContext(),extras)

    b. add more code in this class to handle push, data, in-app

If above steps do not work, please provide further details per your case.

Zinna
  • 1,947
  • 2
  • 5
  • 20