华为服务端推送参数非法?

问题描述

Hi,大家好,我在使用华为服务端推送的时候遇到了参数非法的问题,想请问哪位老铁能帮我看看是缺少哪个参数 吗?

推送内容

Array
(
    [nsp_ts] => 1503371363
    [nsp_fmt] => JSON
    [access_token] => CFmk2uXbdAN749DMEhEb6O6uycoPvwfescbfddXZu7EhwiMakTKGTHZH1YGVLqF3jSz9jMrBbsvZhSCdilOveA==
    [push_type] => 1
    [tokens] => 0864264020863996300000649100CN01
    [tags] =>
    [exclude_tags] =>
    [android] => {"notification_title":"hello world","notification_content":"hello world content","notification_status_icon":"","content_file_url":"","doing":1,"smsContent":"","mmsUrl":"","url":"","intent":"","extra":""}
    [send_time] => 1503371363
    [expire_time] => 1503457763
    [device_type] => 1
    [message] =>
    [target_user_type] =>
    [allow_periods] =>
    [nsp_svc] => openpush.openapi.notification_send
)

返回的错误码

"{\"result_desc\":\"Illegal parameter\",\"result_code\":80200001,\"request_id\":\"150337136611424039595000000\"}"

谢谢啦!

阅读 3.8k
3 个回答

那边的文档没有对错误码的解释?

@meng_先生

这个号我已经不用了,我用的新号回复你~~

这是我们线上用的json内容,以下example替换为你的APP名,仔细参考intent字段就行了,当初我在这也花费了不少时间,华为PHPSDK完全没这样讲,还是参考的JavaSDK来发现的。如果你们有安卓端APP,且安卓端集成了这个SDK,那么可以问问你的安卓端同事。

{
  "hps": {
    "msg": {
      "type": 3,
      "body": {
        "content": "test0258",
        "title": "test0258"
      },
      "action": {
        "type": 1,
        "param": {
          "appPkgName": "com.example.app",
          "intent": "intent://pushexample/notification?title=test0258&content=test0258&keyValue={exttype:article,pushid:81334}&#Intent;scheme=appexample;launchFlags=0x10000000;end"
        }
      }
    },
    "ext": {
      "customize": [
        {
          "exttype": "article"
        },
        {
          "pushid": "81334"
        }
      ]
    }
  }
}

希望能节约你的时间:)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题