无法使用本机连接到Pusher

问题描述

您好,我是新手,我想尝试使用pusher-js创建实时聊天应用程序,所以我安装了软件包 npm install pusher-js @ react-native-community / netinfo 并放入我的useEffect中的以下代码

useEffect(() => {
    // Enable pusher logging - don't include this in production
    Pusher.logToConsole = true;

    var pusher = new Pusher('REDACTED',{
        cluster:"eu"});

    var channel = pusher.subscribe('my-channel');
    channel.bind('my-event',function(data) {
        alert(JSON.stringify(data));
    });
    
},[])

并且我在控制台中得到了这个 Link of the image

我使用react-native run-android来运行,而im使用物理设备。 预先感谢您可以提供的所有帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)