1. 通知栏消息 - 单条
api
国内app https://paas-push-api.immomo.com/push/gateway/notification
海外app https://paas-push-api-hw.immomo.com/push/gateway/notification
http方法:post
请求方式 : x-www-form-urlencoded 或 form-data
请求参数
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
timestamp | 当前时间戳,例:1522222222 | 是 | int | 无 |
sign | 签名,生成算法 md5(appid + appkey + timestamp) | 是 | string | 无 |
appId | 是 | string | 无 | |
packageName | android的packageName,如果无android传ios的bundle id | 是 | string | 无 |
title | 例:第一条push | 是 | string | 无 |
content | 例:第一条push | 是 | string | 无 |
target | 别名/token,例:T-ab3ae1e11a12771a-9831-0 | 是 | string | 无 |
pushType | 别名方式:ALIAS,token方式:TOKEN | 是 | string | 无 |
source | 业务id 规则:[a-zA-Z0-9_]{1,20},数据统计所需,后台发送任务固定为1 | 是 | string | default |
actionType | OPEN_APP/OPEN_URL/CUSTOMIZE, 分别为"打开应用/打开url/跳转指定页面" | 是 | string | 无 |
channelId | 客户端设置的channelId | target >= 26时必须,同客户端确认 | string | 无 |
action | actionType:OPEN_URL/CUSTOMIZE时有效,OPEN_URL:https://targeturl(必须为https) ,CUSTOMIZE:填activity的名字,此activity客户端必须设置为expore=true | 否 | string | 无 |
intentAction | 与action作用相同,google push使用此字段 | 否 | string | 无 |
actionParams | actionType:CUSTOMIZE时有效,例:{"param1":"value1","param2":"value2"},android和ios通用 | 否 | string(map的json序列化) | 无 |
vendorPushSwitch | android是否通过厂商通道下发 | 否 | int | 0 |
badge | 角标数字,小米,apple有效 | 否 | int | 0 |
hwBadgeAddNum | 设置应用角标数值,取值范围1-99。官方文档 | 否 | int | 0 |
hwBadgeClass | 桌面图标对应的应用入口Activity类例如“com.test.badge.MainActivity” 官方文档 | 否 | string | 无 |
sound | android铃声,文件名, 客户端target >= 26无效 | 否 | string | 无 |
soundSwitch | android是否开启铃声,客户端target >=26无效 | 否 | int | 0 |
vibration | android震动, 客户端target>= 26无效 | 否 | int | 0 |
breathingLight | android呼吸灯, 客户端target >=26 无效 | 否 | int | 0 |
picture | 图片,必须为https地址 | 否 | string | 无 |
notifyId | 通知栏覆盖消息的id,相同id,客户端会覆盖前一条 | 否 | int | 无 |
showOnlyBackstage | 仅后台运行时才展示消息,自通道+小米支持 | 否 | int | 0 |
offLine | 是否进入离线队列,例:是1,否0 | 否 | int | 0 |
offLineTtl | 离线队列存在时间,单位s | 否 | int | 600 |
iphoneSound | iphone的声音,不传此字段无声音。传"default"为系统默认声音,自定义声音需要传项目中加载的声音文件名。 | 否 | string | 无 |
dmData | 统计相关数据(传数据之前找push开发人员确认),例:{"_data":"{\"taskId\":\"1111\"}"} | 否 | string(json序列化) | 无 |
showTime | 定时展示时间,单位s,0为立即展示 | 否 | int | 0 |
showExpire | 定时展示过期时间,单位s,如果在showTime-showExpire这段时间,没有展示出来则消息过期 | 否 | int | 0 |
popNotify | 是否浮动通知,浮动:1 不浮动:0 | 否 | int | 1 |
autoCancel | 是否自动清除,清除:1,不清除:0 | 否 | int | 1 |
forceToSelfVendors | 某个厂商优先走自通道,枚举值(大写):OPPO,VIVO,XIAOMI,HUAWEI,可以传多个,英文逗号,号分割 | 否 | string | 无 |
iosTextStyle | 0或不设置:默认样式(标题加粗)1:标题不加粗 2:不展示标题,只展示内容 | 否 | int | 0 |
addImBadge | app气泡数是否累加im消息气泡。非im应用必须设置0,否则影响效率。im应用必须设置1,否则气泡数混乱。 | 否 | int | 0 |
messageSort | 是否使用vivoIM消息push资源(此资源属于vivo内测资源,需要单独找vivo申请,如无此资源,不需要传这个字段) 使用此资源传1 | 否 | int | 0 |
apnsMutableContent | 系统将在传递之前将通知传递给您的Notification Service应用程序扩展,使用您的扩展程序来修改通知的内容。1为生效 0或不传该字段为无效,>=ios10开始支持 | 否 | string | 无 |
vendorExtra | 厂商的扩展参数,如 {"xiaomi":{"channel_id":"xxxx"}} | 否 | object | 无 |
vendorExtra说明
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
vendorExtra.xiaomi | 小米厂商的扩展字段 | 否 | object | 无 |
vendorExtra.xiaomi.channel_id | 小米厂商的channelId 小米官方文档说明 | 否 | string | 无 |
vendorExtra.huawei.apiVersion | 华为api版本,5:表示使用5.x版本api,其他值表示2.x版本api | 否 | string | 2021-07-20之前注册的app,默认值为空,之后的注册的默认值为5 |
返回结果
{
"ec": 0,
"em": "success"
}
详细状态码
码值 | 含义 |
---|---|
0 | 成功 |
100001 | 消息ID生成失败 |
100002 | 参数校验失败 |
100003 | 目标用户未注册 |
100004 | 目标用户注册异常 |
100005 | 参数格式异常 |
100006 | 未找到渠道 |
2. 通知栏消息 - 批量
api
国内app:https://paas-push-api.immomo.com/push/open/notification/batch
海外app:https://paas-push-api-hw.immomo.com/push/open/notification/batch
请求参数
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
timestamp | 当前时间戳,例:1522222222 | 是 | int | 无 |
sign | 签名,生成算法 md5(appid + appkey + timestamp) | 是 | string | 无 |
appId | 是 | string | 无 | |
packageName | android的packageName | 是 | string | 无 |
title | 例:第一条push | 是 | string | 无 |
content | 例:第一条push | 是 | string | 无 |
targets | [{"target":"93241506","badge":1},{"target":"1234567890","badge":2}] | 是 | string | 无 |
pushType | targets类型,别名方式:ALIAS,token方式:TOKEN | 是 | string | 无 |
source | 业务id 规则:[a-zA-Z0-9_]{1,20} | 是 | string | default |
actionType | OPEN_APP/OPEN_URL/CUSTOMIZE, 分别为"打开应用/打开url/跳转指定页面" | 是 | string | 无 |
channelId | 客户端设置的channelId | target>=26时必须,同客户端确认 | string | 无 |
action | actionType:OPEN_URL/CUSTOMIZE时有效,OPEN_URL:https://targeturl (必须为https),CUSTOMIZE:填activity的名字 | 否 | string | 无 |
intentAction | 与action作用相同,google push使用此字段 | 否 | string | 无 |
actionParams | actionType:CUSTOMIZE时有效,例:{"param1":"value1","param2":"value2"} | 否 | string(json序列化) | 无 |
vendorPushSwitch | android是否通过厂商通道下发 | 否 | int | 0 |
badge | 角标数字,小米,apple有效 | 否 | int | 0 |
sound | 铃声,文件名 | 否 | string | 无 |
soundSwitch | 是否开启铃声 | 否 | int | 0 |
vibration | 震动 | 否 | int | 0 |
breathingLight | 呼吸灯 | 否 | int | 0 |
picture | 图片,必须为https地址 | 否 | string | 无 |
notifyId | 通知栏覆盖消息的id,相同id,客户端会覆盖前一条 | 否 | int | 无 |
showOnlyBackstage | 仅后台运行时才展示消息,自通道+小米支持 | 否 | int | 0 |
offLine | 是否进入离线队列,例:是1,否0 | 否 | int | 0 |
offLineTtl | 离线队列存在时间,单位s | 否 | int | 600 |
iphoneSound | iphone的声音,同单条push | 否 | string | 无 |
dmData | 统计相关数据(传数据之前找push开发人员确认),例:{"_data":"{\"taskId\":\"1111\"}"} | 否 | string(json序列化) | 无 |
showTime | 定时展示时间,单位s,0为立即展示 | 否 | int | 0 |
showExpire | 定时展示过期时间,单位s,如果在showTime-showExpire这段时间,没有展示出来则消息过期 | 否 | int | 0 |
popNotify | 是否浮动通知,浮动:1 不浮动:0 | 否 | int | 1 |
autoCancel | 是否自动清除,清除:1,不清除:0 | 否 | int | 1 |
forceToSelfVendors | 某个厂商优先走自通道,枚举值(大写):OPPO,VIVO,XIAOMI,HUAWEI,可以传多个,英文逗号,号分割 | 否 | string | 无 |
messageSort | 是否使用vivoIM消息push资源(此资源属于vivo内测资源,需要单独找vivo申请,如无此资源,不需要传这个字段)使用此资源传1 | 否 | int | 0 |
apnsMutableContent | 系统将在传递之前将通知传递给您的Notification Service应用程序扩展,使用您的扩展程序来修改通知的内容。1为生效 0或不传该字段为无效,>=ios10开始支持 | 否 | string | 无 |
vendorExtra | 厂商的扩展参数,如 {"xiaomi":{"channel_id":"xxxx"}} | 否 | object | 无 |
返回结果
{
"ec": 0,
"em": "success"
}
详细状态码
码值 | 含义 |
---|---|
0 | 成功 |
100001 | 消息ID生成失败 |
100002 | 参数校验失败 |
100003 | 目标用户未注册 |
100004 | 目标用户注册异常 |
100005 | 参数格式异常 |
100006 | 未找到渠道 |
3. 透传消息(静默消息)- 单条
api
国内app:https://paas-push-api.immomo.com/push/gateway/penetrate
海外app:https://paas-push-api-hw.immomo.com/push/gateway/penetrate
参数
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
timestamp | 当前时间戳,例:1522222222 | 是 | int | 无 |
sign | 签名,生成算法 md5(appid + appkey + timestamp) | 是 | string | 无 |
appId | 是 | string | 无 | |
packageName | app包名同注册使用包名,例:com.keda.demo | 是 | string | 无 |
target | 别名/token,例:T-ab3ae1e11a12771a-9831-0 | 是 | string | 无 |
source | 业务id 规则:[a-zA-Z0-9_]{1,20} | 是 | string | default |
pushType | 别名方式:ALIAS,token方式:TOKEN | 是 | string | 无 |
message | ios对应payload的message | 是 | string(json序列化) | 无 |
vendorPushSwitch | android是否通过厂商通道下发 | 否 | int | 0 |
offLine | 是否进入离线队列,例:是1,否0 | 否 | int | 0 |
offLineTtl | 离线队列存在时间,单位s | 否 | int | 600 |
vendorExtra | 厂商的扩展参数,如 {"xiaomi":{"channel_id":"xxxx"}} | 否 | object | 无 |
vendorExtra说明
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
vendorExtra.huawei.apiVersion | 华为api版本,5:表示使用5.x版本api,其他值表示2.x版本api | 否 | string | 2021-07-20之前注册的app,默认值为空,之后的注册的默认值为5 |
返回结果
{
"ec": 0,
"em": "success"
}
详细状态码
码值 | 含义 |
---|---|
0 | 成功 |
100001 | 消息ID生成失败 |
100002 | 参数校验失败 |
100003 | 目标用户未注册 |
100004 | 目标用户注册异常 |
100005 | 参数格式异常 |
100006 | 未找到渠道 |
4. 透传消息(静默消息)- 批量
api
国内app:https://paas-push-api.immomo.com/push/open/penetrate/batch
海外app:https://paas-push-api-hw.immomo.com/push/open/penetrate/batch
参数
字段 | 备注 | 必传 | 类型 | 默认值 |
---|---|---|---|---|
timestamp | 当前时间戳,例:1522222222 | 是 | int | 无 |
sign | 签名,生成算法 md5(appid + appkey + timestamp) | 是 | string | 无 |
appId | 是 | string | 无 | |
packageName | app包名同注册使用包名,例:com.keda.demo | 是 | string | 无 |
targets | [{"target":"93241506"},{"target":"1234567890"}] | 是 | string | 无 |
source | 业务id 规则:[a-zA-Z0-9_]{1,20} | 是 | string | default |
pushType | 别名方式:ALIAS,token方式:TOKEN | 是 | string | 无 |
message | ios对应payload的message | 是 | string(json序列化) | 无 |
vendorPushSwitch | android是否通过厂商通道下发 | 否 | int | 0 |
offLine | 是否进入离线队列,例:是1,否0 | 否 | int | 0 |
offLineTtl | 离线队列存在时间,单位s | 否 | int | 600 |
返回结果
{
"ec": 0,
"em": "success"
}
详细状态码
码值 | 含义 |
---|---|
0 | 成功 |
100001 | 消息ID生成失败 |
100002 | 参数校验失败 |
100003 | 目标用户未注册 |
100004 | 目标用户注册异常 |
100005 | 参数格式异常 |
100006 | 未找到渠道 |