-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 推送API,Notification里Android增加channel_id
* 增加批量单推接口 * 增加接口: 送达统计详情(新)/v3/received/detail * 增加接口: 送达状态查询 /v3/status/message * 增加接口: 消息统计详情(VIP 专属接口,新)/v3/messages/detail
- Loading branch information
zhengjh
committed
Sep 4, 2019
1 parent
9043048
commit a87b5d0
Showing
16 changed files
with
256 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,3 +94,5 @@ typings/ | |
|
||
\.idea/ | ||
package-lock.json | ||
/examples/Conf.js | ||
/test/BaseTest.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var JPush = require("../index.js").JPush; | ||
var Conf = require("./Conf.js"); | ||
|
||
console.log(Conf.appKey); | ||
console.log(Conf.masterSecret); | ||
var client = JPush.buildClient(Conf.appKey, Conf.masterSecret); | ||
console.log(client.appkey); | ||
console.log(client.masterSecret); | ||
|
||
var singlePayloads = [ | ||
{"platform":"all", "target":"regid1", "notification":{"alert":"alert title"}}, | ||
{"platform":"all", "target":"regid2", "notification":{"alert":"alert title"}}, | ||
]; | ||
|
||
client.batchPushByRegid(singlePayloads, function(err, res) { | ||
console.log(err); | ||
console.log(res); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,41 @@ | ||
var JPush = require("../index.js").JPush; | ||
var Conf = require("./Conf.js"); | ||
|
||
var client = JPush.buildClient('96261ea4bcaae3f4a167a495', 'db1abbffbb619458b7785164') | ||
var client = JPush.buildClient(Conf.appKey, Conf.masterSecret); | ||
|
||
client.getReportReceiveds('746522674,344076897', function (err, res) { | ||
if (err) { | ||
if (err instanceof JPush.APIConnectionError) { | ||
console.log(err.message) | ||
// Response Timeout means your request to the server may have already received, | ||
// please check whether or not to push | ||
console.log(err.isResponseTimeout) | ||
} else if (err instanceof JPush.APIRequestError) { | ||
console.log(err.message) | ||
function getReportReceiveds() { | ||
client.getReportReceiveds('746522674,344076897', function (err, res) { | ||
if (err) { | ||
if (err instanceof JPush.APIConnectionError) { | ||
console.log(err.message) | ||
// Response Timeout means your request to the server may have already received, | ||
// please check whether or not to push | ||
console.log(err.isResponseTimeout) | ||
} else if (err instanceof JPush.APIRequestError) { | ||
console.log(err.message) | ||
} | ||
} else { | ||
for (var i = 0; i < res.length; i++) { | ||
console.log(res[i].android_received) | ||
console.log(res[i].ios_apns_sent) | ||
console.log(res[i].msg_id) | ||
console.log('------------') | ||
} | ||
} | ||
} else { | ||
for (var i = 0; i < res.length; i++) { | ||
console.log(res[i].android_received) | ||
console.log(res[i].ios_apns_sent) | ||
console.log(res[i].msg_id) | ||
console.log('------------') | ||
} | ||
} | ||
}); | ||
} | ||
|
||
client.getReportReceivedDetail('746522674,344076897', function(err, res) { | ||
console.log(err); | ||
console.log(res); | ||
}) | ||
|
||
client.getReportStatusMessage(746522674, ['regid1', 'regid2'], null, function(err, res) { | ||
console.log(err); | ||
console.log(res); | ||
}) | ||
|
||
client.getReportMessagesDetail('746522674,344076897', function(err, res) { | ||
console.log(err); | ||
console.log(res); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.