Skip to content

Commit 3d931fb

Browse files
author
Helperhaps
committed
add status message
1 parent 5bec830 commit 3d931fb

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

doc/api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,16 @@ $report->getReceived('msg_id');
307307
$report->getReceived(['msg_id1', 'msg_id2']);
308308
```
309309

310+
#### 送达状态查询
311+
312+
```php
313+
$report->getMessageStatus('msg_id0', 'rid0')
314+
# OR
315+
$report->getMessageStatus('msg_id0', ['rid0', 'rid1'])
316+
#OR
317+
$report->getMessageStatus('msg_id0', ['rid0', 'rid1'], '2017-12-21')
318+
```
319+
310320
#### 获取消息统计
311321

312322
```php

src/JPush/ReportPayload.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ public function getReceived($msgIds) {
3131
return Http::get($this->client, $url);
3232
}
3333

34+
public function getMessageStatus($msgId, $rids, $data = null) {
35+
$url = $this->client->makeURL('report') . ' status/message';
36+
$registrationIds = is_array($rids) ? $rids : array($rids);
37+
$body = [
38+
'msg_id' => $msgId,
39+
'registration_ids' => $registrationIds
40+
];
41+
if (!is_null($data)) {
42+
$body['data'] = $data;
43+
}
44+
return Http::post($this->client, $url, $body);
45+
}
46+
3447
public function getMessages($msgIds) {
3548
$queryParams = '?msg_ids=';
3649
if (is_array($msgIds) && !empty($msgIds)) {

src/JPush/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22
namespace JPush;
33

4-
const VERSION = '3.5.26';
4+
const VERSION = '3.5.27';

0 commit comments

Comments
 (0)