echo '<b>updateTagDevices</b>' . $br; if ($result->isOk) { echo 'Update Device Tag and Alias Success' . $br; } else { echo 'Update Device Tag and Alias Fail' . $br; } echo $br; } catch (APIRequestException $e) { printAPIRequestErrorStack($e); } catch (APIConnectionException $e) { printAPIConnectionErrorStack($e); } /*----Tags Example----*/ try { //获取当前应用的所有标签列表 $result = $client->getTags(); $payload = $result->body; echo '<b>getTags</b>' . $br; echo 'Tags:' . json_encode($payload['tags']) . $br; echo $br; } catch (APIRequestException $e) { printAPIRequestErrorStack($e); } catch (APIConnectionException $e) { printAPIConnectionErrorStack($e); } try { //查询某个用户是否在tag下 $result = $client->isDeviceInTag($REGISTRATION_ID1, $TAG1); $payload = $result->body; echo '<b>isDeviceInTag</b>' . $br; echo 'isDeviceInTag:' . json_encode($payload['result']) . $br;
function testGetTags() { $client = new JPushClient($this->appKey, $this->masterSecret); $result = $client->getTags(); $this->assertTrue($result->isOk === true); }