1. Go to this page and download the library: Download hedeqiang/im 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/ */
hedeqiang / im example snippets
php bin/hyperf.php vendor:publish hedeqiang/im
SDK_APP_ID=
IDENTIFIER=
SECRET_KEY=
declare(strict_types=1);
namespace App\Controller;
use Hedeqiang\IM\Exceptions\Exception;
use Hedeqiang\IM\Exceptions\HttpException;
use Hedeqiang\IM\IM;
use Hyperf\Config\Annotation\Value;
class IndexController extends AbstractController
{
/**
* @Value(key="im")
*/
protected $config;
public function index()
{
$config = $this->config;
$im = new IM($config);
$params = [
'To_Account' => ['hedeqiang']
];
print_r($im->send('openim','querystate',$params));
}
}