-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetPushMsgResult.js
More file actions
30 lines (26 loc) · 915 Bytes
/
getPushMsgResult.js
File metadata and controls
30 lines (26 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
var utils = require('./getui/utils');
var httpManager = require('./httpManager');
//填写mastersecret
var MASTERSECRET = "TBokfpttQJ6aHIhBE9y867";
//填写appkey
var APPKEY = "tpDVam96sY8pxhwBupJ462";
//填写taskId
var TASKID = "OSA-0317_P27U10hFHD95qKFxvfoKN5";
var HOST = "http://sdk.open.api.igexin.com/apiex.htm";
getPushMsgResult(HOST, APPKEY, MASTERSECRET, TASKID, function(err, data) {
console.log(data);
});
function getPushMsgResult(url, Appkey, masterSecret, taskId, callback) {
var str = masterSecret + 'action' + 'getPushMsgResult' + 'appkey' + Appkey + 'taskId' + taskId;
var sign = utils.md5(str);
var postData = {
action: 'getPushMsgResult',
appkey: Appkey,
taskId: taskId,
sign: sign
};
httpManager.post(url, postData, function(err, data) { //返回一个JSON格式的数据
callback && callback(err, data);
});
}