0
Pusher 및 Laravel에 내 알림을 개인 채널에 브로드 캐스팅하려고합니다.Pusher 및 Laravel에 브로드 캐스트 알림에 오류가 있습니다.
내 bootstrap.js처럼 파일
import Echo from 'laravel-echo'
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: '5c3621c15520b7e2fb02',
cluster: 'ap2'
});
Pusher.log = function(message){
window.console.log(message)
}
및 콘솔에서
<script>
export default {
mounted() {
this.listen()
},
props: ['id'],
methods: {
listen() {
Echo.private('App.User.' + this.id)
.notification((notification) => {
alert('new notification')
})
}
}
}
</script>
내 BroadcastServiceProvider.php 아래처럼 아래
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot() {
Broadcast::routes();
Broadcast::channel('App.User.*', function ($user, $userId) {
return (int) $user->id === (int) $userId;
});
}
}
처럼 내 notification.vue 파일 아래에 아래에 같은 오류가 나타납니다
Pusher : State changed : connecting -> connected with new socket ID 334.3086157
Pusher : No callbacks on private-App.User.1 for pusher:subscription_error
if I changed BROADCAST_DRIVER=driver
그것은
Pusher : State changed : connecting -> connected with new socket ID
Pusher : No callbacks on private-App.User.1 for pusher:subscription_error
나는이 문제를 어떻게 해결할 수 아래 같은 오류를 준다?
코드를보고 싶습니다. 편집 해주세요. –