Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc ios fails to initate connection #130

Open
windmillcode0 opened this issue Jul 9, 2024 · 0 comments
Open

webrtc ios fails to initate connection #130

windmillcode0 opened this issue Jul 9, 2024 · 0 comments

Comments

@windmillcode0
Copy link

windmillcode0 commented Jul 9, 2024

Greetings for the flutter webrtc ios library it seems that when ios is the intiatior of the connection it has a problem with setting the remote descriptiion even wehn the signaling state is correct
image

this is indeed correct for the caller the frame work still seems to throw the error, its fine when the ios device is the callee but not the caller
heres my code

// File: RTCPeerConnection.m

- (void)peerConnectionSetRemoteDescription:(RTCSessionDescription*)sdp
                            peerConnection:(RTCPeerConnection*)peerConnection
                                    result:(FlutterResult)result {
  // Log SDP
  NSLog(@"Setting remote description with SDP: %@", sdp.sdp);

  // Ensure this is called on the main thread
  dispatch_async(dispatch_get_main_queue(), ^{
    // Log signaling state before setting the remote description
    NSLog(@"Signaling state before setting remote description: %ld", (long)peerConnection.signalingState);
    
    [peerConnection setRemoteDescription:sdp completionHandler:^(NSError * _Nullable error) {
      if (error) {
        NSLog(@"Failed to set remote description: %@", error.localizedDescription);
        result([FlutterError errorWithCode:@"SetRemoteDescriptionFailed"
                                   message:[NSString stringWithFormat:@"Error %@", error.localizedDescription]
                                   details:nil]);
      } else {
        // Log signaling state after setting the remote description
        NSString *stateString = [self stringForSignalingState:peerConnection.signalingState];
             result(stateString);
      }
    }];
  });
}

can this be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant