Closed putheng closed 4 years ago
hey @putheng did u manage to trigger event ?
You can use the Pusher debug console to test sending events: https://dashboard.pusher.com/
Select your app at the bottom of that screen.
@MisterJimson thx for ur reply, but could this plugin can do something like pusher.trigger([channel],event,data) ?
@LtotheWT it would be possible, but typically the client side SDK listens to events, and the server side SDK sends events. You should be triggering events from your backend, not a client side device.
I was very surprised to find this library doesn't allow triggering events. Would be quite a common use case.
@athornz I can understand that assumption, but Pusher is designed to have events triggered by your backend.
One reason would be your Pusher secret. The "secret" is only used when triggering events on the server, where as you use your app "key" on the client side. If you include the secret oon the client side then someone else can get access to it and trigger events on your account.
How to triggering events to Pusher server and broadcast to a channel that subscriber subscribes to ?