NativeScript Laravel Echo私人频道无法连接/收听

时间:2020-06-12 08:26:44

标签: laravel nativescript-angular laravel-echo

我有一个nativeScript应用,该应用使用Laravel Echo从后端获取一些数据。
基本上我发现了一个包:nativescript-laravel-echo
但是我在控制台中看不到回声连接到后端并接收数据。
我的echo.service.ts如下所示:

connect(data) {
        this.token = getString('_token');
        console.log('echo...');
        this.Echo = new TnsEcho({
            broadcaster: 'socket.io',
            host: "https://myurl.com:6001/",
            auth: {
                headers: {
                    'X-Auth-Token': this.token
                }
            },
            debug: true,
        });

        //Delay only with socket.io in ios
        setTimeout(() => {
            this.Echo.private('auctions').listen('NewAuctionCreated', (e) => {
                console.log(e); // can't see in console
                data = e.auctions;
            });
        }, 100);
    }


0 个答案:

没有答案
相关问题