android - 华为Push Kit API - 从rest Api获取Push Id

标签 android push-notification huawei-mobile-services huawei-developers huawei-push-notification

我正在尝试使用 Rest api 通过 HMS 推送向我的 android 应用程序发送通知。

系统可以运行,但我找不到用于查找 Push Id( token )的 API。

{
    "validate_only": false,
    "message": {
        "notification": {
            "title": "Notifica simpatica",
            "body": "Io sono il body della notifica simpatica",
            "notify_icon": "https://res.vmallres.com/pimages//common/config/logo/SXppnESYv4K11DBxDFc2.png"
        },
        "data": "{'param1':'value1','param2':'value2'}",
        "android": {
            "collapse_key": -1,
            "urgency": "NORMAL",
            "category": "PLAY_VOICE",
            "ttl": "1448s",
            "fast_app_target": 1,
            "notification": {
                "click_action": {
                    "type": 1,
                    "intent": ""
                }
            }
        },
        "token": [
            "I NEED THIS"
        ]
    }
}

我已经阅读了有关获取它的推送订阅 api,但两天后我什么也没找到 :(

请 帮我! 谢谢!

最佳答案

PushToken 只能从设备接收。在设备上,您应该执行接收它的方法,然后将此 PushToken 发送到您的后端。

关于android - 华为Push Kit API - 从rest Api获取Push Id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69376742/

相关文章:

android - 方向更改时出现内存不足错误

基于 .NET 的推送通知服务

ios - 推送通知在 Firebase 4.0 中不起作用

android - onTaskRemoved() 在华为和小米设备中没有被调用

publish - 谷歌禁止华为。我应该如何处理 google 依赖项?

huawei-mobile-services - 如何更改华为应用市场中的开发者名称?

javascript - 所选插件似乎不适用于移动浏览器

java - 在 Activity 之间传递数据

java - 屏幕锁定后相机卡住

ios - 静默通知不会在 TestFlight 中发送