# iOS native client support

**URL:** <https://mediasoup.discourse.group/t/ios-native-client-support/421>\
**Category:** mediasoup libraries\
**Created:** [November 21, 2019, 9:42am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421 "2019-11-21T09:42:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [November 21, 2019, 9:42am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/1 "2019-11-21T09:42:04Z")

</div>

Hello,  
I’ve started working on the iOS side of libmediasoup.

I am a complete newbie when it comes to iOS development and I’ve never ported C++ to Objective-C/Swift, so if anyone can help me It would be greatly appreciated.

For now I think I’ve got the base blueprint sorted, and I’m trying to port C++ to Swift (Following various tutorials…)

Repository:

> **[ethand91/mediasoup-ios-client](https://github.com/ethand91/mediasoup-ios-client)**
>
> Mediasoup 3 iOS Client. Contribute to ethand91/mediasoup-ios-client development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [November 21, 2019, 2:35pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/2 "2019-11-21T14:35:36Z")

</div>

Great! BTW it would be great if your project and [this one](https://github.com/haiyangwu/mediasoup-client-android) (mediasoup-client-android) become somehow similar in their design. Remember that you do not need to port any C++ code to ObjC but just use the C++ API exposed by libmediasoupclient and provide an ObjC wrapper for its API.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [November 22, 2019, 2:07am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/3 "2019-11-22T02:07:28Z")

</div>

@ibc  
For clarity I will try to implement it as close to the android SDK as possible.

From what I’ve read it seems the below is the best approach?  
libmediasoup C++ -\> Objective-C++ Wrapper -\> Objective-C Wrapper.  
The above allows objective-c user’s with zero knowledge of c++ to use the library, and with a bridging header also allows Swift users to use the library.

If anyone has a better approach/example implementations please share.  
For now I’ll work on the Objective-C++ Wrappers

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [November 23, 2019, 2:34pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/4 "2019-11-23T14:34:09Z")

</div>

I’m not an expert in Objective C/C++. Just wondering, why not going directly to Swift instead?

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [November 24, 2019, 11:32am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/5 "2019-11-24T11:32:19Z")

</div>

> I’m not an expert in Objective C/C++. Just wondering, why not going directly to Swift instead?

Unfortunately this can not be done, We need a way to “port” the c++ object to objective-c/Swift.  
Sort of like an iOS version of Android JNI.

For example:  
C++ mediasoupclient::Consumer → Objective-C++ (mediasoupclient::Consumer to NSObject) → Objective-C (NSObject)  
Swift users will need to use a bridging header to be able to use the Objective-C header.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [December 9, 2019, 3:04am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/6 "2019-12-09T03:04:20Z")

</div>

Update:  
All of the base libmediasoupclient has been implemented. 🙂  
There are still some small things that need to be implemented, which will be complete once I’ve tested it on a sample application.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 9, 2019, 10:23am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/7 "2019-12-09T10:23:05Z")

</div>

Amazing. Thanks. Please keep working on it as your convenience. We’ll come back to this to make it oficial in the future when we get some time.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [December 11, 2019, 10:08am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/8 "2019-12-11T10:08:11Z")

</div>

Sample client source:

> **[ethand91/mediasoup-ios-client-sample](https://github.com/ethand91/mediasoup-ios-client-sample)**
>
> Sample iOS mediasoup client sample. Contribute to ethand91/mediasoup-ios-client-sample development by creating an account on GitHub.

So far I’ve managed to get as far as Producer.produce.  
Once the SDK is finalized I’ll start work on the docs.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 11, 2019, 10:34am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/9 "2019-12-11T10:34:21Z")

</div>

Looks really nice

---

<div class="post-metadata">

**Author:** ![jmillan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jmillan/32/9_2.png) [@jmillan](https://mediasoup.discourse.group/u/jmillan)\
**Post date:** [December 12, 2019, 9:13am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/10 "2019-12-12T09:13:07Z")

</div>

Really great @ethand91!

We’ll check it in detail as soon as we get some time.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 14, 2019, 8:15pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/13 "2019-12-14T20:15:49Z")

</div>

You made you question. Please do not directly mention authors to insist and get a response.

This is an open source project. Don’t ask things for free just because you need them, please.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 15, 2019, 10:17pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/15 "2019-12-15T22:17:31Z")

</div>

There is people contributing to mediasoup by making those native SDKs for iOS and Android. That’s a good point to start. You may try them and provide your feedback so there is more people involved into this. We, the authors, do the max we can do taking into account that this is an Open Source project.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [December 19, 2019, 6:09am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/16 "2019-12-19T06:09:39Z")

</div>

Update:  
Usage example created:

> <https://github.com/ethand91/mediasoup-ios-client/blob/master/README.md>

Still needs a couple of tweaks etc. Also trying to upload it to cocoapods for smoother implementation.  
Be grateful if anyone could try to use the library and give me any feedback/advice. (iOS is not my strong point ;))

Thinking of adding the mediasoup-ios-client documentation to the mediasoup website, would this be ok?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 19, 2019, 1:46pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/17 "2019-12-19T13:46:27Z")

</div>

Hi @Rakshitha-M-Rodrigo, will you be able to test this and provide feedback, please?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [December 19, 2019, 1:56pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/18 "2019-12-19T13:56:53Z")

</div>

> [@ethand91](#):
>
> Thinking of adding the mediasoup-ios-client documentation to the mediasoup website, would this be ok?

We’ll love to have it in the mediasoup website. However, before that we really need to take a depth look into the code to be able to properly document it and provide support here about it if needed. Unfortunately we are specially busy these weeks and it’s not a good timing for it. We promise we’ll do it in the future. In the meanwhile, please document all the API in the README (or wherever you prefer).

For now, I’ve added it to the website here:

> **[mediasoup :: GitHub](https://mediasoup.org/github/#3rd-party-contributions)**
>
> Cutting Edge WebRTC Video Conferencing

is it ok?

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [December 20, 2019, 5:00am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/19 "2019-12-20T05:00:32Z")

</div>

@ibc  
Understood, For now I’ll put the API in it’s own directory on the repository.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [February 27, 2020, 8:35am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/20 "2020-02-27T08:35:02Z")

</div>

Cocoapods has been supported, making implementation easier.

Next I would like to implement the following:

- VP9 support (iOS does not enable VP9 support by default)
- Bitcode support
- Ability to communicate with mediasoup-demo
- API documentation

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [February 27, 2020, 10:57am UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/21 "2020-02-27T10:57:53Z")

</div>

Nice!

However, what do you mean with “Ability to communicate with mediasoup-demo”? It’s up to you, but I would not include any WebSocket nor a demo specific stuff into the lib.

---

<div class="post-metadata">

**Author:** ![ethand91](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ethand91/32/14_2.png) [@ethand91](https://mediasoup.discourse.group/u/ethand91)\
**Post date:** [February 27, 2020, 1:47pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/22 "2020-02-27T13:47:06Z")

</div>

> However, what do you mean with “Ability to communicate with mediasoup-demo”?

What I meant was having a sample that communicates with the mediasoup-demo, therefore you don’t need to implement the server side in order to test it out.  
Pretty much the iOS version of this sample:

> **[GitHub - haiyangwu/mediasoup-demo-android: mediasoup android demo...](https://github.com/haiyangwu/mediasoup-demo-android)**
>
> mediasoup android demo https://demo.mediasoup.org. Contribute to haiyangwu/mediasoup-demo-android development by creating an account on GitHub.

> It’s up to you, but I would not include any WebSocket nor a demo specific stuff into the lib

Definitely not going to be including it the lib 😉

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [February 27, 2020, 2:31pm UTC](https://mediasoup.discourse.group/t/ios-native-client-support/421/23 "2020-02-27T14:31:08Z")

</div>

Great

[Next page](https://mediasoup.discourse.group/t/ios-native-client-support/421.md?page=2)
