Skip to content

Commit 0e0f420

Browse files
author
Helperhaps
committed
add clear tags
1 parent b168ed9 commit 0e0f420

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ $device->addTags($registration_id, ['tag1', 'tag2']);
358358
$device->removeTags($registration_id, 'tags');
359359
// OR
360360
$device->removeTags($registration_id, ['tag1', 'tag2']);
361+
// 清空所有 tag
362+
$device->clearTags($registration_id);
363+
361364
// 更新 mobile
362365
$device->updateMoblie($registration_id, '13800138000');
363366

src/JPush/DevicePayload.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public function updateMoblie($registration_id, $mobile) {
3434
return $this->updateDevice($registration_id, null, $mobile);
3535
}
3636

37+
public function clearTags($registration_id) {
38+
$url = $this->client->makeURL('device') . $registrationId;
39+
return Http::post($this->client, $url, [tags: '']);
40+
}
41+
3742
public function updateDevice($registrationId, $alias = null, $mobile = null, $addTags = null, $removeTags = null) {
3843
$payload = array();
3944
if (!is_string($registrationId)) {

0 commit comments

Comments
 (0)