0

I have chatkit version 1.1 installed. I used sendMessage() method to send text message. Now i want to use sendMultipartMessage() method but got "Call to undefined method Chatkit\Chatkit::sendMultipartMessage()". sendSimpleMessage is not working as well.

Chatkit Version

"pusher/pusher-chatkit-server": "^1.1", "pusher/pusher-php-server": "^3.4",

public function SendMessage(Request $request){
    //return $request->all();
    $user = $this->LoggedInUser();
    $chatkit = $this->Authenticate();
    $room_id = Session::get($user->username);
    $chatkit->sendMultipartMessage([
        'sender_id' => $user->username,
        'room_id' => $room_id,
        //'text' => $request->message,
        'parts' => [
            [ 'type' => 'image/png',
              'url' => 'https://placekitten.com/200/300' ],
            [ 'type' => 'text/plain',
              'content' => 'simple text' ],
            [ 'type' => 'binary/octet-stream',
              'file' => file_get_contents('https://placekitten.com/200/300'),
              'name' => 'kitten',
              'customData' => [ "some" => "json" ],
              'origin' => 'http://example.com'
            ]
          ]
    ]);

Pusher Authentication:

public function Authenticate(){
    return  new Chatkit([
        'instance_locator' => config('services.chatkit.locator'),
        'key' => config('services.chatkit.key'),
    ]);        
}
weaver
  • 453
  • 1
  • 8
  • 21

1 Answers1

0

You will need to upgrade your Chatkit library. The method you are using was introduced in v1.2. See the changelog for details.

doydoy
  • 4,021
  • 3
  • 20
  • 33