pusher

Class 'Pusher' not found

安稳与你 提交于 2019-12-04 19:56:11
问题 When I install Pusher package, I got an error "Class 'Pusher' not found". 回答1: Claudio's diagnosis is correct, the namespace Pusher was added in version 3; but changing the Laravel files is not a recommended solution. A better way is to create an alias in config/app.php . Under the 'aliases' key, add this to the array in the "Third Party Aliases" section: 'Pusher' => Pusher\Pusher::class, 回答2: With the version 3 of Pusher I realized that there is changed the namespace for Pusher\Pusher. If

TideSDK not working with Pusher

喜你入骨 提交于 2019-12-04 19:08:18
I'm trying to develop a desktop application coded in HTML, CSS, jQuery and PHP, compiled with TideSDK. This application needs to receive real-time notifications from a webpage, so that when a user clicks on a specific button on the website, the desktop application captures that immediately. I've found Pusher for this matter, and it works great between two websites, but it appears as "unavailable" to connect in a desktop application with TideSDK. This is what I get from the web: Pusher : State changed : initialized -> connecting Pusher : Connecting : {"transport":"ws","url":"ws://ws.pusherapp

Why do we need products like Pusher and Socket.io to establish a websocket connection?

China☆狼群 提交于 2019-12-04 16:05:20
问题 I've been reading about websockets and SaaS like Pusher and Socket.io recently, while working on my Laravel chat practice application. What I don't understand is, why do we need external software to establish a websocket connection? Can't the server code like Laravel just directly establish the connection with the front-end like Vue.js? Why does it have to go through the middleman like Pusher and Socket.io? Sorry for the noob question. 回答1: It doesn't have to. Those pieces of software just

Pusher send presence event to specific member

爷,独闯天下 提交于 2019-12-04 12:33:45
Is it possible to specify the member id of an event so that only that member would receive the event? If for instance I want to send a notification to a user (who's user ID I know) how would I do that? I'm storing the member/user ID in the presence authentication - $pusher->presence_auth($_POST['channel_name'], $_POST['socket_id'], $user_id) , $user_data); I want to be able to trigger an event for a specific user_id $pusher->trigger( 'presence-test', 'test_event', $data, $socket_id ); Is it possible? Any advice appreciated, thanks! You can't send events to specific users/clients on a channel.

Real-time push update to only one user (not channel) at a time. How to do that?

北城以北 提交于 2019-12-04 03:28:01
问题 I'm creating a web app/site in which my server will push real-time update to clients some info (using Pusher api). So, the USERS that subscribe to a CHANNEL can receive the update when the server pushes updates to this CHANNEL. However, (because of the nature of my application) there should be only one USER that receive a real-time update at a time. In other words, an update is actually targeted to not a specific CHANNEL, but a specific USER. My current solution is: Each CHANNEL allows only

Laravel: Pusher events do not broadcast from within eloquent's event listener

旧巷老猫 提交于 2019-12-03 18:11:27
问题 I'm having issues doing event broadcasting using Pusher from within an Eloquent event listener. My event are being fired and sent out from Laravel controller perfectly. However, it seems that the broadcasts are not actually reaching pusher when I trigger them from within my Eloquent event listener. The boot method of my app/Providers/AppServiceProvider.php contains: MyModel::saving(function($record){ doSomeStuf(); // trigger event $pusher = \App::make('pusher'); $channel = $record->username;

Class 'Pusher' not found

旧街凉风 提交于 2019-12-03 14:06:34
When I install Pusher package, I got an error "Class 'Pusher' not found". Claudio's diagnosis is correct, the namespace Pusher was added in version 3; but changing the Laravel files is not a recommended solution. A better way is to create an alias in config/app.php . Under the 'aliases' key, add this to the array in the "Third Party Aliases" section: 'Pusher' => Pusher\Pusher::class, With the version 3 of Pusher I realized that there is changed the namespace for Pusher\Pusher. If configure by composer when set it out the .env, BROADCAST_DRIVER=pusher, it's showing that error. Checking out the

How to use Pusher with Django?

。_饼干妹妹 提交于 2019-12-03 07:49:49
问题 I am trying to build an app using pusher and django. I went through few of the links like https://github.com/pusher/django-pusherable, but it lacked an example and thus was difficult to understand! Can anyone please help in here? And also what are channels in here and thus how to create a follow-following system with feeds(activity streams)? Thanks! 回答1: Pusher allows you to easily implement a publish/subscribe pattern for messaging (also called pub/sub for short). In this pattern, there are

How to use Pusher with Django?

妖精的绣舞 提交于 2019-12-02 21:15:15
I am trying to build an app using pusher and django. I went through few of the links like https://github.com/pusher/django-pusherable , but it lacked an example and thus was difficult to understand! Can anyone please help in here? And also what are channels in here and thus how to create a follow-following system with feeds(activity streams)? Thanks! Pusher allows you to easily implement a publish/subscribe pattern for messaging (also called pub/sub for short). In this pattern, there are a number of channels. Each channel is like a radio station's frequency. A publisher puts messages on a

why pusher works on localhost but not on a live website

自作多情 提交于 2019-12-02 05:59:25
I've used Pusher API to put a simple push notification in place. I've tested everything and Pusher works on my localhost . When I put the same code on a live website, Pusher doesn't publish my message. That's interesting to note that if I push from localhost I can see the message on the live version. It seems that I have no problem subscribing to a channel, but the problem is that I cannot publish a message on the channel. This is my code: // Create pusher event $pusher=Yii::app()->pusher; $data = array('message'=>"myMessageContent"); $pusher->trigger('test_channel','my_event',$data); Is there