-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_111_xinge.js
36 lines (29 loc) · 989 Bytes
/
test_111_xinge.js
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
31
32
33
34
35
36
/**
* Created by yuanyuan on 17/3/19.
*/
const debug = require('debug')('xinge');
const Promise = require('bluebird');
const Xinge = require('xinge');
const ios_access_id = 2200256808;
const ios_secret_key = '133309dd59528a53119070fedef467c7';
const content = '标题行';
const badge = 1;//未读数
const device_id = 'B0704496-9EEA-445F-8B8C-D79B92276725';
const XingeApp = new Xinge.XingeApp(ios_access_id, ios_secret_key);
let iosMessage = new Xinge.IOSMessage();
//以下都为默认值
iosMessage.alert = content;
iosMessage.badge = parseInt(badge);
iosMessage.sound = 'df';
iosMessage.acceptTime.push(new Xinge.TimeInterval(0, 0, 23, 0));
//TODO 先使用测试环境
XingeApp.pushToSingleDevice(device_id, iosMessage, Xinge.IOS_ENV_DEV, function (err, result) {
if (typeof result === 'string') {
try {
result = JSON.parse(result);
} catch (e) {
}
}
debug('xinge_push result = ');
debug(result);
});