neoPusher plugin coming soon (real time communication) - Forum

Forum Navigation
You need to log in to create posts and topics.

neoPusher plugin coming soon (real time communication)

Page 1 of 2Next

Next VisualNEO Web version will include a simple plugin to use basic Pusher functionalities.
A free Pusher account allows up to 100 concurrent users and 200.000 messages a day for real time communication.
Think about chats, multiplayer games, real time data graphs... (web hosting mandatory)

neoChat is a sample app you can test right now:
https://visualneo.com/tutorials/neochat

Note that you can load the same app in different browser tabs or devices to test it.
Chat log is not recorded nor saved!

Let me know what you think :)

Vadim, Ivanes82 and 5 other users have reacted to this post.
VadimIvanes82CDY@44CN_IcemanDarbdenraljavadrajabihakamiroccocogliano

Hi @luishp,

Very nice !

Nice Luis. Would it be possible to save several days, or view previous messages of the day when login ?

Hi @phil78, yes of course. You can mix the techniques shown here and in this other sample app using neoCms plugin.
Regards.

Great!!!

@luishp

The new features are impressive!!! Very cool!!! Thank you so much!!!

Hi @luishp When you create your pusher channel how do you fill the fields to work in a browser or in a phone pwa ?

 

Uploaded files:
  • You need to login to have access to uploads.

@phil78 it doesn't matter. The options Pusher offers are just to help you with sample code.
But use JQuery and PHP if you want as it's the closest environment to VisualNEO Web.
Rememember to download neoPusher from the downloads section and edit index.php with your Pusher data.
Regards.

Good Evening @luishp index.php contain the good values after download for new Pusher\Pusher.

Should I replace $pusher->trigger('My_channel', 'My_Event', $data) also with the real values ?

in the app I have neoPusherSend "Lpg78" "Send" [clientData] "Succes" "Echec", $data should be replace by [clientData] ?.

I subscribe to new-message, should I have also a ligne $pusher->trigger with this event ?

I tried to start from  the neocms3 and neopusher sample to do the messaging but using phpExecSql instead of neocms.
As soon as I launch the app I have this error, I don't know if it interferes but I never see my messages, the pusher console shows the activity well but not my message.

Uncaught TypeError: $scope.NeoApp_StartUp is not a function

    jQuery 9
    Angular 16
    jQuery 13

@phil78 please try to make the neoChat sample app to work for you first using your own Pusher account.
You just need to edit this information in file index.php:

$pusher = new Pusher\Pusher("APP_KEY", "APP_SECRET", "APP_ID", array('cluster' => 'APP_CLUSTER'));

It should be something like this (fake data):

$pusher = new Pusher\Pusher("f32cdwe67b964dfnu1df", "27bbb7ba578fae8d64a23", "1415655", array('cluster' => 'eu'));

Then open neoChat sample app and go to Project > App Events to change this code:

.Initialize Pusher
neoPusherInitialize "f32cdwe67b964dfnu1df" "eu" "https://yourdomain.com/index.php" false

.Connects to Pusher
neoPusherSubscribe "channel-name" "event-name" "your-parse-subroutine"

And that's all. Once you succeed then try to mix it with databases, etc.

Regards.

@luihp This is what I did but my messages are not displayed in the chat container and on the pusher console I only see the hello word of the index.php.

neoPusherSubscribe "Lpg78" "new-message" "parseData"

There is nothing on the app console.

@phil78 are you using neoPusher server side script?

Yes I have send.php and vendor folder installed.

@phil78 does the neoChat sample app work for you?
What PHP version are you using server side? (I think PHP version 7.3 or higher is needed in order to execute Pusher libraries)
The installation is very simple so I think probably the problem comes from your server setup.

Regards

@luihp The server use php 7.4. and the sample works for me.
index.php is called when I use neoPusherSend, but after I do not go to parseData ? I will send you the app to check.

Uploaded files:
  • You need to login to have access to uploads.

@phil78 if you take a look at the web browser Console (F12) you will see there is a CORS error.
Have you included this at the very top of your index.php file?

<?php
//Header required when app and php are of different origins
header("Access-Control-Allow-Origin: *");

Regards.

@luishp Sorry "error" was not activated in the debugger I had not seen the cors error.
I modified index.php, I have no more error but I still do not pass into parseData

@phil78 I have sent you an index.php file with my Pusher credentials.
Please upload it to your server and caal it from the original neoChat sample app.
This way we can narrow the problem a bit more as it could be:

  • Your server.
  • Your index.php.
  • Your pusher channel configuration.

Regards.

Great ! @luishp my index.php did not contain
$input_data = $_POST;
$theChannel = $_POST['channel'];
$theEvent = $_POST['event'];
Now it works!
I will try to go back to my first complete app with these updates.
Thanks a lot for your help
Best regards

luishp has reacted to this post.
luishp

Great! :)

Page 1 of 2Next