/** * @beforeClass */ public static function init() { $client = new JPushClient('dd1066407b044738b6479275', '6b135be0037a5c1e693c3dfa'); $client->updateDeviceTagAlias('0900e8d85ef', 'alias1', array('tag1', 'tag_all')); $client->updateDeviceTagAlias('0a04ad7d8b4', 'alias1', array('tag2', 'tag_all')); }
/** * @beforeClass */ public static function init() { $client = new JPushClient('dd1066407b044738b6479275', '2b38ce69b1de2a7fa95706ea'); $client->updateDeviceTagAlias('0900e8d85ef', 'alias1', array('tag1', 'tag_all')); $client->updateDeviceTagAlias('0a04ad7d8b4', 'alias1', array('tag2', 'tag_all')); }
$result = $client->removeDeviceTag($REGISTRATION_ID1); echo '<b>removeDeviceTag</b>' . $br; if ($result->isOk) { echo 'Remove Device Tag Success' . $br; } else { echo 'Remove Device Tag Fail' . $br; } echo $br; } catch (APIRequestException $e) { printAPIRequestErrorStack($e); } catch (APIConnectionException $e) { printAPIConnectionErrorStack($e); } try { //更新指定RegistrationId的指定属性,当前支持tags, alias $result = $client->updateDeviceTagAlias($REGISTRATION_ID1, $ALIAS1, array($TAG1, $TAG2), array($TAG3)); 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 { //获取当前应用的所有标签列表
function testUpdateDeviceTagAlias() { $client = new JPushClient($this->appKey, $this->masterSecret); $result = $client->updateDeviceTagAlias($this->REGISTRATION_ID1, $this->ALIAS1, array($this->TAG1, $this->TAG2), array($this->TAG3, $this->TAG4)); $this->assertTrue($result->isOk === true); }