1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- require __DIR__ . '/../config.php';
- $result = $client->device()->getDevices($registration_id);
- print "before update alias = " . $result['body']['alias'] . "\n";
- print 'updating alias ... response = ';
- $response = $client->device()->updateAlias($registration_id, 'jpush_alias');
- print_r($response);
- $result = $client->device()->getDevices($registration_id);
- print "after update alias = " . $result['body']['alias'] . "\n\n";
- $result = $client->device()->getDevices($registration_id);
- print "before add tags = [" . implode(',', $result['body']['tags']) . "]\n";
- print 'add tag1 tag2 ... response = ';
- $response = $client->device()->addTags($registration_id, 'tag0');
- print_r($response);
- $response = $client->device()->addTags($registration_id, ['tag1', 'tag2']);
- print_r($response);
- $result = $client->device()->getDevices($registration_id);
- print "after add tags = [" . implode(',', $result['body']['tags']) . "]\n\n";
- $result = $client->device()->getDevices($registration_id);
- print "before remove tags = [" . implode(',', $result['body']['tags']) . "]\n";
- print 'removing tag1 tag2 ... response = ';
- $response = $client->device()->removeTags($registration_id, 'tag0');
- print_r($response);
- $response = $client->device()->removeTags($registration_id, ['tag1', 'tag2']);
- print_r($response);
- $result = $client->device()->getDevices($registration_id);
- print "after remove tags = [" . implode(',', $result['body']['tags']) . "]\n\n";
- $result = $client->device()->getDevices($registration_id);
- print "before update mobile = " . $result['body']['mobile'] . "\n";
- print 'updating mobile ... response = ';
- $response = $client->device()->updateMoblie($registration_id, '13800138000');
- print_r($response);
- $result = $client->device()->getDevices($registration_id);
- print "after update mobile = " . $result['body']['mobile'] . "\n\n";
|