Loading

MobPush推送接口配置

一、错误码4801

{
    "status": 4801,
    "res": null,
    "error": "WhiteIpError: appkey:2f2d7a68f8a40,request:61.174.27.279,webIps:61.174.05.208"
}

遇到这种问题是因为没有在mob后台添加您调用这个推送接口的外部ip,这里可以看到它提示请求的ip是61.174.27.279,接下来我们到mob后台添加这个ip就好了。
按图添加

二、V3接口推送鉴权

推送的详细可以看https://www.mob.com/wiki/detailed/?wiki=MobPushRestAPIfenlei1333&id=136 。这里只讲sign的获取

sign值为(请求体+AppSecret的值)md5加密 32位小写
例如

{"source":"webapi","appkey":"2f2d7a68f8a40","pushTarget":{"target":1},"pushNotify":{"plats":[1],"content":"推送的内容","type":1}}9abee316611dd24f607feb9f2c496338

对这一串进行MD5加密得出eb276f35cf6480169b2d3e2e509db680,这个就是sign的值了,下面上推送图:
image.png
image.png
image.png

posted @ 2021-01-06 13:39  冲锋的麦克  阅读(780)  评论(0编辑  收藏  举报