后台SDK接入


友盟

U-Push

  1. U-Push API文档

http://dev.umeng.com/sdk_integate/android_push_apidoc

  • App应用信息页面获取 Appkey 和 App Master Secret
  • 在Web后台添加服务器IP地址做IP白名单安全验证或关闭IP白名单
  • 发送限制
1
2
3
4
广播(broadcast)默认每天可推送10次
组播(groupcast)默认每分钟可推送5次
文件播(filecast)默认每小时可推送300次
自定义播(customizedcast, 且file_id不为空)默认每小时可推送300次
  1. 消息发送
  • 调用地址

POST

http接口:http://msg.umeng.com/api/send?sign=mysign

https接口:https://msgapi.umeng.com/api/send?sign=mysign

  • 签名(sign=mysign)的计算方式

计算MD5值,形成一个32位的十六进制(字母小写)字符串,即为本次请求sign(签名)的值;
Sign=MD5($http_method$url$post-body$app_master_secret);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
appkey = '你的appkey'
app_master_secret = '你的app_master_secret'
timestamp = '你的timestamp'
method = 'POST'
url = 'http://msg.umeng.com/api/send'
params = {'appkey': appkey,
'timestamp': timestamp,
'device_tokens': device_token,
'type': 'unicast',
'payload': {'body': {'ticker': 'Hello World',
'title':'你好',
'text':'来自友盟推送',
'after_open': 'go_app'},
'display_type': 'notification'
}
}
post_body = json.dumps(params)
print post_body
sign = md5('%s%s%s%s' % (method,url,post_body,app_master_secret))

例如:

1
POSThttp://msg.umeng.com/api/send{"policy":{"expire_time":"2018-03-27 09:06:02"},"description":"qweqwe","production_mode":true,"appkey":"5a77fca0b27b0a5f3f0000cb","payload":{"body":{"title":"fdasfa","ticker":"fdasfa","text":"qweqwewqewq","after_open":"go_app","play_vibrate":"false","play_lights":"false","play_sound":"true"},"display_type":"notification"},"type":"broadcast","timestamp":"1521856908422"}bedyc7rzfqdy2wcvycrkabprdil2bpmc

计算得到MD5

914c16508236ab0908e0728301d27d04

a