Cannot resolve symbol 'HmsMessageService' in android stuido

Issue

I am trying to implement push notifications for Huawei.

For that I am following this toturial:

https://developer.huawei.com/consumer/en/codelab/HMSPushKit/index.html#7

But on step 8, when I implement this:

public class MyPushService extends HmsMessageService {
private static final String TAG = "PushDemoLog";
@Override
public void onNewToken(String token) {
    super.onNewToken(token);
    Log.i(TAG, "receive token:" + token);
}

}

I get this error on HmsMessageService.

Cannot resolve symbol ‘HmsMessageService’

I have added all dependencies as referred in the article. Have installed the hmstoolkitsdk-tool,5.2.0.3000.

This are my Build gradle dependencies:
enter image description here

How can i resolve this error?

Thanks

Solution

The following is Huawei Push demo, You are advised to follow the README.md step by step : https://github.com/HMS-Core/hms-push-clientdemo-android

Answered By – zhangxaochen

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published