【关键字】
token报错 / 错误码:1000900010
【问题描述】
问题一:
按照文档已正常接入鸿蒙token申请方法,可以正常申请到token。代码没有改动,但是目前申请token报错,返回错误码 {"code":1000900010}。
申请代码如下:
import pushService from '@hms.core.push.pushService';
try {
const pushToken: string = await pushService.getToken()
} catch(err) {
let err: BusinessError = error as BusinessError
console.error(`申请推送token失败: ${JSON.stringify(err)}`)
}
【解决方案】
可以检查以下几类错误:
-
应用在AppGallery Connect上创建时未选择HarmonyOS应用类型。
-
应用在AppGallery Connect上配置的应用签名证书指纹与实际不匹配。
-
应用未在项目模块级别下的src/main/module.json5(例如entry/src/main/module.json5)中配置client_id。详情请参见配置Client ID。