# iOS - Unified Plan - ver 1.106.1 - PeerConnectionFactory does not return RTCPeerConnection instance

**URL:** <https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676>\
**Category:** iOS\
**Created:** [December 12, 2022, 7:48am UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676 "2022-12-12T07:48:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfojtl](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/jfojtl/32/165_2.png) [@jfojtl](https://react-native-webrtc.discourse.group/u/jfojtl)\
**Post date:** [December 12, 2022, 7:48am UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/1 "2022-12-12T07:48:42Z")

</div>

I have this JS code:

```auto
const pc = new RTCPeerConnection(configuration);
pcPeers[socketId] = pc;

pc.onicecandidate = function (event) {
	// ...
};

pc.onnegotiationneeded = function () {
	// ...
};

pc.oniceconnectionstatechange = function (event) {
	// ...
};
pc.onsignalingstatechange = function (event) {
	// ...
};

pc.onaddstream = function (event) {
	// ...
};

pc.addStream(localStream);
return pc;

```

pc.addStream will fail to add the stream to the PeerConnection. I dug deeper in objective-c code (I have no prior experience with objc) and I found out that WebRTCModule+RTCPeerConnection.m:96 does not create a peerConnection but returns null. I cannot “step into” this call.

```auto
RTCPeerConnection *peerConnection
            = [self.peerConnectionFactory peerConnectionWithConfiguration:configuration
                                                              constraints:constraints
                                                                 delegate:self];

```

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [December 12, 2022, 10:16am UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/2 "2022-12-12T10:16:54Z")

</div>

Are you sure you’re running version `1.106.1` of the module?  
Sounds more like you are running one of the new beta versions that removes `addStream` due to Unified Plan coming into service which replaces Plan B.

Have a look at [addTrack](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTrack) and [addTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addTransceiver).

---

<div class="post-metadata">

**Author:** ![jfojtl](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/jfojtl/32/165_2.png) [@jfojtl](https://react-native-webrtc.discourse.group/u/jfojtl)\
**Post date:** [December 12, 2022, 10:54am UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/3 "2022-12-12T10:54:35Z")

</div>

Yes, we have tried to upgrade to 1.106.1 because of unified plan (google play is now saying plan-b is not supported) - [react-native-webrtc - npm](https://www.npmjs.com/package/react-native-webrtc/v/1.106.1)

Should I update to today released [106.0.0-beta.8](https://www.npmjs.com/package/react-native-webrtc/v/106.0.0-beta.8) ?

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [December 12, 2022, 12:37pm UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/4 "2022-12-12T12:37:37Z")

</div>

We’re working towards a stable release but yes, you should try the latest beta to have Unified Plan support.

---

<div class="post-metadata">

**Author:** ![jfojtl](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/jfojtl/32/165_2.png) [@jfojtl](https://react-native-webrtc.discourse.group/u/jfojtl)\
**Post date:** [December 12, 2022, 12:55pm UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/5 "2022-12-12T12:55:18Z")

</div>

Thank you very much.

Do you have any sort of schedule/roadmap for stable release?

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [December 12, 2022, 1:09pm UTC](https://react-native-webrtc.discourse.group/t/ios-unified-plan-ver-1-106-1-peerconnectionfactory-does-not-return-rtcpeerconnection-instance/1676/6 "2022-12-12T13:09:54Z")

</div>

There hasn’t been much discussion around that subject as of yet but hopefully soon 👍

**Edit:**  
Seems i spoke too soon, the stable release has just gone out 😃
