PHP code example of imphinite / tencent-cloudcomm
1. Go to this page and download the library: Download imphinite/tencent-cloudcomm library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imphinite / tencent-cloudcomm example snippets
composer
" ....,
"imphinite/tencent-cloudcomm",
},
'providers' => [
...
CloudComm\ServiceProvider\CloudCommServiceProvider::class,
]
'aliases' => [
...
'CloudComm' => CloudComm\Facades\CloudComm::class,
]
/*
|----------------------------------
| SDK App ID
|------------------------------------
*/
'sdkappid' => 'YOUR APP ID',
...,
/*
|----------------------------------
| Identifier
|------------------------------------
*/
'identifier' => 'YOUR APP ADMIN IDENTIFIER',
...,
/*
|----------------------------------
| UserSig
|------------------------------------
*/
'usersig' => 'YOUR ADMIN USERSIG',
use CloudComm;
...
$service = CloudComm::load('register-account')
->setParam([
'Identifier' => 'testaccount1',
'IdentifierType' => 3, // refer to Tencent documentation
'Password' => 'Testaccount1Password!'
]);
$response = $service->get();
...
$service = CloudComm::load('register-account')
->setParamByKey('Identifier', 'testaccount1')
->setParamByKey('IdentifierType', 3)
->setParamByKey('Password', 'Testaccount1Password!'); //return $this
...
$service = CloudComm::load('get-user-status')
->setParam([
'To_Account' => [
'testaccount1',
'testaccount2'
]
]);
$response = $service->get();
...
CloudComm::load('nearbysearch')
...
$service = CloudComm::load('register-account')
->setParamByKey('Identifier', 'testaccount1')
->setParamByKey('IdentifierType', 3)
->setParamByKey('Password', 'Testaccount1Password!'); //return $this
...
$service = CloudComm::load('register-account')
->setParam([
'Identifier' => 'testaccount1',
'IdentifierType' => 3, // refer to Tencent documentation
'Password' => 'Testaccount1Password!'
]);
...
$response = CloudComm::load('register-account')
->setParam([
'Identifier' => 'testaccount1',
'IdentifierType' => 3, // refer to Tencent documentation
'Password' => 'Testaccount1Password!'
])->get();
var_dump(json_decode($response)); // output
...