createOffer() promise does not resolve (or reject) on iOS 13.0
See original GitHub issuecreateOffer() promise does not resolve (or reject) on iOS 13.0
I was testing with iOS 13.0 recently and I noticed that I was having an error connecting to peers. After some debugging, I found that the createOffer
method is not behaving as expected on iOS 13.0. On iOS 12.2, and below, everything works as expected.
Expected behavior
- Expected
createOffer()
method in RTCPeerConnection to either resolve or reject promise.
Observed behavior
- When calling
createOffer()
, the promise is neither resolved or rejected.
Steps to reproduce the problem
On iOS 13.0:
import * as WebRTC from 'react-native-webrtc';
const configuration = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}]};
const pc = new WebRTC.RTCPeerConnection(configuration);
pc.createOffer().then(desc => console.log(desc)).catch(err => console.log(err))
// nothing happens
on iOS 12.2:
import * as WebRTC from 'react-native-webrtc';
const configuration = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}]};
const pc = new WebRTC.RTCPeerConnection(configuration);
pc.createOffer().then(desc => console.log(desc)).catch(err => console.log(err))
// Successfully resolves.
// RTCSessionDescription {sdp: "v=0[...]}
Platform information
- React Native version: 0.61.2
- Plugin version: 1.75.0
- OS: iOS
- OS version: 13.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
RTCPeerConnection.createOffer() - Web APIs | MDN
The createOffer() method of the RTCPeerConnection interface ... value is a Promise which, when the offer has been created, is resolved with ...
Read more >javascript - RTCPeerConnection.createOffer "promise" usage
the below code, is newer one, would work in latest firefox, wont work in latest chrome: localConnection.createOffer() .then(offer => localConnection.
Read more >ipv6 support for RTCPeerConnection.createOffer() for iOS
RTCPeerConnection.createOffer() Promise is neither returning resolved (with local SDP) nor any error on iOS platform on ipv6 network. Working ...
Read more >619289 - [WebRTC] Promise-based createOffer() ignores ...
The offer does not contain any m-lines. ... The legacy createOffer() implementation instead, ... on Mon, Jun 13, 2016, 1:45 AM PDT.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, Guys(@saghul , @spiside ) I faced same problem. But in my case, createOffer() promise does not resolve/reject even iOS 12.4 simulator. I spend a lot of time for resolve this problem. Because my other react-native-webrtc projects worked well, but this time it didn’t work.
Anyway, My solution is just divide RTCPeerConnection and its configuration.
it works !
I used both the iPhone 8 and the iPhone X for the simulator. Both had the same issue for 13.x. Funny enough, it was the update that upgraded the simulator versions that caused the break. So far I’ve had no troubles using my phone on 13.1 and the 12.2 as the simulator.