【问题标题】:Huawei Push Kit API - get Push Id from rest Api华为 Push Kit API - 从 rest Api 获取 Push Id
【发布时间】:2021-11-21 09:09:52
【问题描述】:

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

系统工作正常,但我找不到找到Push Id(令牌)的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 的信息,但两天后我什么也没找到 :(

请 帮我! 谢谢!

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      mohax 的回答是正确的。我想补充一点:

      pushtoken是客户端集成Push SDK后,通过SDK提供的API获取的。获取pushtoken后,需要发送到服务器。

      详情请参考Docs

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-29
        • 2022-01-18
        • 2021-06-26
        • 1970-01-01
        • 2022-11-09
        • 2020-11-12
        相关资源
        最近更新 更多