PHP code example of qiaweicom / rongcloud
1. Go to this page and download the library: Download qiaweicom/rongcloud 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/ */
qiaweicom / rongcloud example snippets
'providers' => [
// ...
QiaWeiCom\RongCloud\Providers\RongCloudServiceProvider::class,
]
public function getToken()
{
$rongCouldAppKey = config('rong_cloud.appKey');
$rongCouldAppSecret = config('rong_cloud.appSecret');
$RongCloud = new RongCloud($rongCouldAppKey, $rongCouldAppSecret);
echo ("\n***************** user **************\n");
// 获取 Token 方法
$result = $RongCloud->user()->getToken('userId1', 'username', 'http://www.rongcloud.cn/images/logo.png');
echo "getToken ";
print_r($result);
echo "\n";
}