I'm desperate :(
A week ago I found this wonderful tutorial for WebSockets in PHP
http://www.sanwebe.com/2013/05/chat-using-websocket-php-socket
Everything is working fine but I want, that only 2 user chat with each other (private chat). To declare which users will chat with each other I want to use their IDs from my existing site.
The chat should be an add-on for an existing community.
If you have any idea how to do this, I'll be very thankful!
Thank you for your time!
Related
So I've been using heroku meme api on my discord js bot, it was working fine untill today when it didn't respond I decided to check the website but when I opened it it gave me an application error, idk how to fix it any help would be appreciated the link I use is
https://meme-api.herokuapp.com/gimme
Heroku has discontinued free dynos and data services, it's possible that API was using those.
https://blog.heroku.com/next-chapter
I am not new in computers; I am a .NET developer, but was presented with this great opportunity to develop in PHP, so I took it. There is a need to open an Outlook/Item (email) form the website; is that even possible? I know there is functionality in CakePHP to send emails but client wants to use their own Outlook application.
Any pointer would be much appreciated! Have a great coding day...
There ist no easy Way in PHP. PHP will be executed on a webserver and not on the client computer.
There ars some ways to solve this, depend on your needs:
You can open the standard mail-client with an HTML-Link like this:
E-Mail senden
If this is too rudimentary, you can send an nice formated email via smtp/sendmail to an emailadress.
cakephp mailer class documentation
You can also try to connect via IMAP an put mailobjects into the draft-folder. There are some basic PHP functions for this: PHP IMAP documentation
Only in the first case, outlook will open the email in a Window.
I have a website running Laravel in the back-end, where users can create reports for other users.
When the report is created I would like to send a push notification to recipient user's desktop.
Do I need to use services like Pusher, OneSignal?
Any useful site with examples would be appreciated.
Your question
You could use Pusher, Redis/Socket.io, Pubnub, etc. Which one to use? well, this is more an opinion-based question.
These services broadcast events, then in your client apps (like your web front-end) you configure the client-side libraries of the service you choose to subscribe (to channels) and listen to those events. The documentation explains it better.
Examples/tutorials
Pusher
This is a tutorial published by the Pusher team.
Redis/Socket.io
This one
is a Laracasts series about this.
Just google.
Update
There is a Laravel-specific alternative, a package created exclusively for Laravel:
Laravel WebSockets
This is the post talking about the package and its inner working.
This is the repo.
Here you have the documentation.
If you like to show Native Desktop notification then i would suggest Web Push notification. In this way once user subscribed to push notification ,they will get real time notification and does not need to be on your website.
https://github.com/laravel-notification-channels/webpush
I am trying to figure out how to get chat working in the Smart Admin Theme
As I can see, the newer version ships with a Chat beta plugin. On the "About the API" page, it gives a few instructions on how to get the front end working but unfortunately has no information about the back end.
How do I go about implementing the back end for this chat? Do I purchase an account at CometChat. And even if I do, I am still confused about the implementation both on the back and the front end.
I mean do I listen to some events from CometChat, like from some web sockets and then check to see the new message and open a new window on the front end to display it there? Does it work like Pusher, maybe?
I terribly apologize for the vagueness of this question. It is just that I am confused about this and am not able to explain myself in well manner. Can somebody point me in the right direction on how to get the chat feature working if my back end web service is built using Laravel 5?
I am currently trying to use nodeJS with Socket.io. This guide will help you a long way: http://socket.io/get-started/chat/
The reason I chose for nodeJS with Socket.io, is that it's realtime. The use of sockets allows you to send messages from server to client, instead of making your client poll for new messages every x seconds.
With some JavaScript skills, you could easily make a nice chat application with person to person chat or even chatrooms.
I've created a test MVC5 application to run the simple SignalR chat client shown here and everything worked as the tutorial described.
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc
I've then created another project where I enable Windows Authentication and my messages are not being received by the chat clients. However, my message requests are hitting the "ChatHub" Send method but my chat clients are not receiving the messages. Everything is identical to the original tutorial except for adding Windows Authentication. Any ideas what could be my problem? Thanks in advance.
jquery.signalR-2.1.2.min.js
Appears to be a user error. I jumped between the original SignalR tutorial and SignalR with MVC5 tutorial and ran into a discrepancy. Original SignalR tutorial had chat.client.addNewMessageToPage" and the SignalR with MVC5 tutorial "chat.client.broadcastMessage" and I must have botched the copy and paste job between projects and tutorials. Feeling a little sheepish at the moment.