【发布时间】:2021-12-22 20:14:16
【问题描述】:
我正在使用 HMS 推送工具包来获取通知。通知在大约 1 周前工作正常,但现在当我重新运行该代码时,它无法正常工作。 我交叉检查了所有东西,但找不到任何东西。 我使用的依赖是:
implementation 'com.huawei.hms:push:5.1.1.301'
我也在我的项目中添加了 agconnect-services.json。 还在清单中添加了应用程序 ID。 SHA-256 密钥也可以。
接收通知的代码是:
public class HMSMessageService extends HmsMessageService {
@Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
}
}
我还在清单文件中添加了此服务的标签。
我也尝试使用 HMS 工具包(android studio 中的编码助手),从那里发送通知是成功的,但我没有在应用程序上收到它。
要查看Logcat 日志,请点击here
【问题讨论】:
标签: android notifications huawei-mobile-services huawei-developers huawei-push-notification