简体   繁体   中英

Huawei push kit message not received from clevertap push console

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);

    }

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM