PHP code example of leehom1988 / rongcloud-sdk-php

1. Go to this page and download the library: Download leehom1988/rongcloud-sdk-php 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/ */

    

leehom1988 / rongcloud-sdk-php example snippets



LeeHom\RongCloud\RongClient;
use LeeHom\RongCloud\Exception\RongCloudException;
use GuzzleHttp\Exception\GuzzleException;

$client = new RongClient('xxxxxxxxxx', 'xxxxxxxxxx');
try {
    $r = $client->User()->getToken('user_id', 'test name', 'http://www.rongcloud.cn/images/logo.png');
    echo $r;
} catch (RongCloudException $e) {
    echo $e->getMessage();
} catch (GuzzleException $e) {
    echo $e->getMessage();
}
bash
$ composer