Home > Enterprise >  Huawei Push Kit API - get Push Id from rest Api
Huawei Push Kit API - get Push Id from rest Api

Time:09-30

I am trying to send notifications to my android app via HMS push with Rest api.

The system works, but I can't find an api to find the Push Id (Token).

{
    "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"
        ]
    }
}

I have read about a push subscription api for get it but after two days i don't find nothing :(

Please help me! Thanks!

CodePudding user response:

PushToken can be received only from device. On device you should execute method for receiving it and then send this PushToken to your backend.

CodePudding user response:

mohax's answer is correct. I'd like to add a little more:

The pushtoken is obtained by using the API provided by the SDK after the client integrates the Push SDK. After obtaining the pushtoken, you need to send it to the server.

For details, pls kindly refer to this Docs.

  • Related