Test APNs Push Notifications
APNs Push API
请求方式:
HTTP
HTTPS
FORM-DATA
返回格式:
JSON
XML
JSONP
请求接口:
- 请求参数
- 返回参数
| 参数名 | 类型 | 必传 | 说明 |
|---|---|---|---|
| file | file | 是 | PEM、P12、P8证书文件 |
| passwd | string | 是 | 证书密码 |
| device | string | 是 | 设备标识 |
| bundle_id | string | 是 | APP包名 |
| message | string | 否 | 消息内容,可以是字符串或者JSON |
| kid | string | 否 | P8证书需传KeyId |
| team_id | string | 否 | P8证书需传Team ID |
| url | string | 否 |
推送地址URL,默认开发。 开发=https://api.development.push.apple.com/3/device/ 沙盒=https://api.sandbox.push.apple.com/3/device/ 生产=https://api.push.apple.com/3/device/ |
| 字段名 | 类型 | 必返 | 说明 |
|---|---|---|---|
| code | int | 是 | code=1推送成功,code=0推送失败 |
| msg | string | 是 | 结果反馈 |
| url | string | 否 | 实际请求的URL地址 |
| send_json | object | 否 | 实际请求的数据 |
| result | string | 否 | 实际推送接口返回的结果 |
- 成功示例
- 失败示例
{
"code": 1,
"url": "https:\/\/api.development.push.apple.com\/3\/device\/aaaaaaaaa",
"send_data": {
"aps": {"alert": "Hello 68API","sound": "default","badge": 0}
},
"result": "",
"msg": "SUCCESS"
}
{"code":0,"msg":"Unable to read the PKCS#12 certificate file."}