PHP code example of jawabapp / chat-sdk

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

    

jawabapp / chat-sdk example snippets


\ChatSDK\Facades\Config::make(array(
    'app_token' => 'token.token.token.token',
));

\ChatSDK\Channels\SendChannel::send(
    1,                  // $sender_id => Your message sender id
    'topic/1',          // $topic => Your group id which is coming after creating a UserChannel
    'text',             // $content_type => This can be text, image, etc
    'content'           // $content => Content of the messages as string
);

\ChatSDK\Facades\Config::make(array(
    'app_token' => 'token.token.token.token',
));

\ChatSDK\Channels\ReceiveChannel::receive(function($message, $sender) {
    echo json_encode($message);
    echo json_encode($sender);
},true);