MrBin99 / LaravelEchoAndroid

Laravel Echo Android client
GNU General Public License v3.0
49 stars 22 forks source link

Laravel Echo Server can't receive connection from Android App #3

Closed danmarkl closed 6 years ago

danmarkl commented 6 years ago

Hi there!

I am glad that I found this project!

By the way, I just want to ask if what's the possible issue why my android app cannot subscribe to any private channel from my laravel echo server?

Basically I followed the sample codes of yours. From creating connection to subscribing to channel and listening to events. But I am only getting connected but cannot subscribe to any private channel(s). I already checked the /channels api endpoint of laravel echo server that I created and cannot see that my android app is subscribed to a channel.

Any help will be much appreciated!

Thanks!

MrBin99 commented 6 years ago

Hi, Thanks for your support !

Take a look at this https://laravel.com/docs/5.6/broadcasting#authorizing-channels on your Laravel PHP application (not Laravel Echo Server).

A user must be authorized to enter private or presence channels.

Verify that you are sending a Bearer token to Laravel Echo Server (see here https://github.com/MrBin99/LaravelEchoAndroid#basic-usage), Laravel Echo Server will automatically call your Laravel PHP app with this token to see if that user can access this channel.