Pusher Channels Flutter 无法在 iOS 设备上运行

问题描述 投票:0回答:2

它在 Android 设备上运行得很好,但我在 iOS 设备上测试时遇到了问题。具体来说,实时通信功能似乎无法在 iOS 设备上运行。

我已经做到了 iOS 特定安装# Pusher Channels Flutter 插件将 Pusher-websocket-swift cocoapod 添加到您的项目中。你可能需要运行一个

$ pod install
在ios目录下。

这是我的 podfile.lock

  - pusher_channels_flutter (0.0.1):
    - Flutter
    - PusherSwift (~> 10.1.1)
  - PusherSwift (10.1.3):
    - NWWebSocket (~> 0.5.3)
    - TweetNacl (~> 1.0.0)

我也打开了这个问题pusher-channels-flutter/issues/115

我需要帮助在 iOS 上构建它

ios flutter pusher pusherswift
2个回答
1
投票

authEndpoint: url
功能中删除
init
,因为它仅在网页版中使用,导致 iOS 上出现问题。

 await pusher.init(
        apiKey: 'f****************',
        cluster: 'eu',
        onConnectionStateChange: onConnectionStateChange,
        onError: onError,
        onSubscriptionSucceeded: onSubscriptionSucceeded,
        onEvent: onEvent,
        onSubscriptionError: onSubscriptionError,
        onDecryptionFailure: onDecryptionFailure,
        onMemberAdded: onMemberAdded,
        onMemberRemoved: onMemberRemoved,

        // authEndpoint: "<Your Authendpoint Url>",  Just delete this line
        
        onAuthorizer: onAuthorizer,
      );

0
投票

我遇到了同样的问题,我所做的就是

  1. 将 podfile 中的
    platform :ios, '12.0'
    更新为
    platform :ios, '13.0'
  2. 在项目的
    ios
    目录中,运行此
    pod install
    ,此错误已解决。

祝您编码愉快,希望这会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.