question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

createOffer() promise does not resolve (or reject) on iOS 13.0

See original GitHub issue

createOffer() 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:closed
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
verycosycommented, May 27, 2020

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.

const config = {
  iceServers: [
    {
      urls: 'stun.l.google.com:19302',
    },
  ],
};
const pc = new RTCPeerConnection();
pc.setConfiguration(config);

it works !

2reactions
spisidecommented, Oct 18, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bountysource
createOffer () promise does not resolve (or reject) on iOS 13.0.
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found