pusher / chatkit-server-php

PHP SDK for Pusher Chatkit
https://pusher.com/chatkit
MIT License
35 stars 20 forks source link

Ionic to php server send message after update #40

Closed BobTheShoplifter closed 4 years ago

BobTheShoplifter commented 5 years ago

What?

When sending a message via an ionic app I get this error after updating to v 1.10 all other functions seem to be working fine. This is the only error i see. If i add message manualy from panel it loads fine and all works well but at message sent i see errors.

Error log :

<br />
<b>Fatal error</b>:  Uncaught Chatkit\Exceptions\ChatkitException: Field `resource_link` is an invalid URL in /home/u418541101/public_html/testapi/checkinapi/vendor/pusher/pusher-chatkit-server/src/Chatkit.php:1126
Stack trace:
#0 /home/u418541101/public_html/testapi/checkinapi/vendor/pusher/pusher-chatkit-server/src/Chatkit.php(853): Chatkit\Chatkit-&gt;execCurl(Resource id #26)
#1 /home/u418541101/public_html/testapi/checkinapi/vendor/pusher/pusher-chatkit-server/src/Chatkit.php(827): Chatkit\Chatkit-&gt;makeRequest(Array, Array)
#2 /home/u418541101/public_html/testapi/checkinapi/vendor/pusher/pusher-chatkit-server/src/Chatkit.php(601): Chatkit\Chatkit-&gt;apiRequest(Array)
#3 /home/u418541101/public_html/testapi/checkinapi/send_message.php(47): Chatkit\Chatkit-&gt;sendMessage(Array)
#4 {main}
 thrown in <b>/home/u418541101/public_html/testapi/checkinapi/vendor/pusher/pusher-chatkit-server/src/Chatkit.php</b> on line <b>1126</b><br />
BobTheShoplifter commented 5 years ago

Also the line 47 of send message

$data = ($chatkit->sendMessage([
   'sender_id' => 'user'.$user->id,
   'room_id' => $chat->chatId,
   'text' => $text,
   'attachment' => [
         'resource_link'=> $user->name,
         'type'=> 'image'
   ]
 ]));
jonathanlloyd commented 4 years ago

We can't seem to reproduce this issue - if this is still happening, please re-open.