102
Views
20
Comments
Solved
[Reactive Pusher Client] Pusher_MessageReceived not working
pusher-reactive-client
Reactive icon
Forge asset by Arley Silveira
Application Type
Reactive

When I click on Send Event button It is showing me Message Sent! but I didn't get the message in Pusher_MessageRecived handler. Please help me to solve this problem.

2021-04-15 14-49-36
Arley Silveira
Solution

If you don't mind, please mark this thread as solved.

You don't need the PusherDummyAuth (it is not a requirement for the reactive client itself), what you will need is an *an* authentication server to authenticate (through a REST API) the users *only* when using private and presence channels.

Refer to the pusher documentation.
https://pusher.com/docs/channels/server_api/authenticating-users

And that's why I have included a dummy auth server for testing purpose and to jump start on how to build yourself one.

Cheers

2021-05-18 02-27-17
Manish Gupta
Champion

Hello Arun

Can you see any error in console? May be the Networking or Communication error!

Can you make that screen visible to us and share the URL? I will try sending the Push from there to catch the error. 

Have never used this Component but let's see if something I can observe to help you


Regards,

Manish Gupta

UserImage.jpg
Arun Pareek

Hello Manish

This is my application URL: https://arun-pareek.outsystemscloud.com/PusherReactiveClientDemo/Pusher

I am getting this error in my console :

Screenshot20210519100000.png
2021-05-18 02-27-17
Manish Gupta
Champion

Can you make the details pre filled please? Else I will need to create account and get those details. I want to see the screen when you trigger to send the message, it says message sent but message not received. 

Give me the page URL on that instance. If you can't share that in Public - Please feel free to reach out me in Messages. 

UserImage.jpg
Arun Pareek

I have shared the pusher details with you on message. Please check.

2021-05-18 02-27-17
Manish Gupta
Champion

Hii Arun

It seems the Implementation is fine but Pusher is not broadcasting the Message because of this error - 


Solution for this I have received is: https://stackoverflow.com/questions/36812075/pusher-cannot-broadcast-client-event

Can you try this?  

Or better you follow the another approach I have shared with you.


Regards

2021-04-15 14-49-36
Arley Silveira

Hi Arun,

Senders do not receive a message they have sent, try opening another browser (ie. 1 on firefox and another on chrome) to test it. You will also need to enable client events on the  Pusher console:
 

Cheers,
Arley

UserImage.jpg
Arun Pareek

Hi Arley

I have enabled the client events from Pusher console and tried to send event from different browsers but did not get any response.

2021-04-15 14-49-36
Arley Silveira

Hi Arun,

Just published a new version, please delete, reinstall and give it another try.

Few notes:

  1. Presence or private channels must be prefixed with "presence-" OR "private-" accordingly;
  2. Client event names must be prefixed with "client-";
  3. Site properties app_key and app_secret @PusherDummyAuth must be set with the values from the pusher console.

Cheers,
Arley

UserImage.jpg
Arun Pareek

Hi Arley

Thanks for your response.

I will install this version and check after that I'll let you know.

UserImage.jpg
Arun Pareek

Hi Arley 

I am still getting this error

In Pusher Console, I got this error

Please help to resolve this.

2021-04-15 14-49-36
Arley Silveira

Do you have cryptoapi component installed?

UserImage.jpg
Arun Pareek

Hi Arley

I have installed cryptoapi component.

Please also explain your point no. 3 of above comment because I didn't find any site property in the application.

2021-04-15 14-49-36
Arley Silveira

Presence and Private channel require authentication, you will need to install the demo which comes with a dummy authentication module (just authenticates sucessfully any request - not good for production :-) ) Also make sure you republish them all since you didn't have cryptoapi installed before.


UserImage.jpg
Arun Pareek

Hi Arley

It is working now.

But I want to know how PusherDummyAuth is working and I have checked, There is no dependency in any modules. Then why we need this?

Thank you for your quick response and support.

2021-04-15 14-49-36
Arley Silveira
Solution

If you don't mind, please mark this thread as solved.

You don't need the PusherDummyAuth (it is not a requirement for the reactive client itself), what you will need is an *an* authentication server to authenticate (through a REST API) the users *only* when using private and presence channels.

Refer to the pusher documentation.
https://pusher.com/docs/channels/server_api/authenticating-users

And that's why I have included a dummy auth server for testing purpose and to jump start on how to build yourself one.

Cheers

UserImage.jpg
Arun Pareek

Hi Arley 

I am implementing this functionality in my project but I am getting below error

I also created a new module which is DummyAuth in my application. 

Please help me in this

2021-04-15 14-49-36
Arley Silveira

Hi Arun,

Please check the demo examples. 


There are two APIs with slightly different implementations:

Once you have your API in place you need to configure endpoint in the listener bloc:

UserImage.jpg
Arun Pareek

Hi Arley

Thanks for your response. 

It is working now.

UserImage.jpg
Arun Pareek

Hi Arley 

When I am using this component in my Real Project So,

When I am connecting to pusher then I am getting Pusher Unavailable error. 

Can you tell me when this error comes?

This would be be very helpful for me.

Also In console, I am getting this error

2021-01-27 15-37-38
Tim Bates

I'm guessing it's because you have a content security policy enabled and haven't configured it to allow access to the pusher.com website?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.