AgoraIO-Extensions / Agora-Flutter-SDK

Flutter plugin of Agora RTC SDK for Android/iOS/macOS/Windows
https://pub.dev/packages/agora_rtc_engine
MIT License
721 stars 374 forks source link

Agora flutterweb Error: TypeError: "{USERID}": type 'String' is not a subtype of type 'num #1850

Open danilo1998271 opened 4 weeks ago

danilo1998271 commented 4 weeks ago

Version of the agora_rtc_engine

^6.3.2

Platforms affected

Steps to reproduce

  1. User 1 and User 2 joins the channel using joinChannelWithUserAccount
  2. User 1 is from flutter web cant hear User 2 from unity but User 2 can hear User 1.
  3. When speaking to the microphone using User 2 an error appears in User 1 saying "safeEmit event:user-info-updated error Error: TypeError: "{USERID}": type 'String' is not a subtype of type 'num?'"

Expected results

User 1(flutterweb) and User 2(unity) can hear each other

Actual results

User 1(flutterweb) can hear User 2(unity), but User 2(unity) can hear User 1(flutterweb)

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

joining of user in flutter web _joinChannel() async { isLiveSession.value = true; await [ Permission.microphone, ].request(); if (kDebugMode) { print("Agora RTC: joining channel"); } await _engine.joinChannelWithUserAccount( token: rtcToken, channelId: rtcChannelName, userAccount: authC.getUid(), options: const ChannelMediaOptions( publishScreenTrack: false, publishSecondaryScreenTrack: true, publishCameraTrack: false, publishMicrophoneTrack: true, publishScreenCaptureAudio: true, publishScreenCaptureVideo: true, publishRhythmPlayerTrack: true, publishMediaPlayerAudioTrack: true, publishMixedAudioTrack: true, publishCustomAudioTrack: true, autoSubscribeAudio: true, enableAudioRecordingOrPlayout: true, clientRoleType: ClientRoleType.clientRoleBroadcaster, ), ); await _engine.adjustRecordingSignalVolume(100); await _engine.adjustPlaybackSignalVolume(100); await _engine.muteLocalAudioStream(false); sessionStatusText.value = "Audio-only $sessionTypeText is running."; }

joining of user in unity // Enable the video module. RtcEngine.EnableVideo(); RtcEngine.EnableAudio(); RtcEngine.EnableLocalVideo(false); RtcEngine.EnableLocalAudio(true);

RtcEngine.SetParameters("{"che.audio.keep.audiosession": true}");

placeHolder.gameObject.SetActive(true); placeHolder.text = "Joining session..."; remoteViewcover.SetActive(true); LiveSessionPanel.SetActive(true);

// Set the user role as audience. RtcEngine.SetClientRole(CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER);

Debug.Log("Agora: Joining channel"); RtcEngine.RegisterLocalUserAccount(_appID, userId); // Join a channel. RtcEngine.JoinChannelWithUserAccount(token, channelName, userId); RtcEngine.MuteLocalAudioStream(true);

Logs

safeEmit event:user-info-updated error Error: TypeError: "{USERID}": type 'String' is not a subtype of type 'num?'

Flutter Doctor output

Doctor output ```console [Paste your output here] ```
guoxianzhe commented 4 weeks ago

@danilo1998271 When using a string uid, there is no issue with web-to-web communication. However, problems may arise when communicating between web and native platforms. It is recommended to use a numerical uid to avoid these issues. Maybe we will fix this issues in the feature.

danilo1998271 commented 3 weeks ago

Is there a work around in our case we need to use string uid in our unity app and in flutter web?

littleGnAl commented 3 weeks ago

It's so sorry that there's no workaround for this issue at this time.