Xamarin Form iOS WebRTC - ios

I'm pretty new to forum and I really appreciate the passion that all of you use to solve the questions.
So I'm here because I'm struggling to integrate the GoogleWebRTC in my Xamarin Form project in the iOS part (I'm been able to make a native objC test app ), I've try to integrate it via CocoaPods with Sharpie Pod and bind it, but I'm not be able to resolve all the errors created in the bind on ApiDefinitions.cs.
After some time I found this project https://github.com/valentingrigorean/apprtc-ios-xamarin that has successfully bind the library and after some bug fix
( editing WebRTCBinding.csproj and remove the -lstdc++.6 linker and removed some errors in code)
but when I try to add that binding library into my project and try to run return me :
Objective-C exception thrown. Name: NSInvalidArgumentException Reason: +[RTCPeerConnectionFactory initializeSSL]: unrecognized selector.
What am I doing wrong?
Thanks in advance.

I was also looking for a solution and spent a lot of time to get it running.
What I did and what helped me with the project you mentioned
- add both projects WebRTC and AppRTC into your project
- link from your project to this both projects
- Deleted lstdc++.6 as you did already
- Add both delegate IARDAppClientDelegate, IRTCEAGLVideoViewDelegate into the class where you want to use it. You can add "RTCPeerConnectionFactory.InitializeSSL();" as test into for example ViewDidLoad and compile it for simulator and device.
Does it work or do you still get erros?

Related

React native QRCode scanner integration problem

im trying to integrate react-native-qrcode-scanner into my project. I do all they say in the installation guide but get following error :
I see that this line of code inside this library fails :
return PermissionsIOS.requestPermission(
PermissionsIOS being imported as
const PermissionsIOS = NativeModules.ReactNativePermissions
So it seems like permissions was not loaded into the project.
Any ideas?
Ok, I found it. The thing is that by some strange reason react-native link react-native-permissions didnt work out. I've read installation on react-native-permissions's page. It says that one of 3 following must be done :
Installation via pods - made only worse
running react-native link react-native-permissions - didnt work in first place
Manual linkage with XCode
Only 3rd alternative did the trick for me.

How to create framework with inner frameworks?

I absolutely can not understand how it works. I started with a simple one: created framework using "Cocoa Touch Framework" template and add some code to source files. Then using cocoapods I installed some pods to this framework-project. All looks good (maybe not so good actually) and build fine. After that there was an attempt to connect my framework to other xcode project. I did this as follows: just took my test.framework file from Product folder and transferred to another project. At first everything was not bad. The import was successful and I can use my framework-code in another project. But when I run it I have error: dyld: Library not loaded: Reason: image not found. I tried all of the answers to this problem, but nothing helped me.
After that, it was decided to try to connect my framework to other project. This time I got a completely different behavior: namely, I was able to connect the framework, but I could not access the code inside it. I'm completely confused, because I did not change anything. I just did the same with another project.
Please help me. What am I doing wrong?
A related questions:
Can I connect the framework just moving test.framework file into
another project?
For some reason, I should use the approach described above, is there a chance in the theory of success or all that I have done before is not correct?
I tried it a lot with the same result you get , until I posted the problem in Apple forums and they respond with Nested frameworks are not supported in IOS

Importing custom iOS framework into two different Xcode projects don't get same result

I am facing some issues on the last two days and I didn't find anything on Internet that help me to solve them.
Here's the problem:
I have a custom iOS framework of my own
I have two different Xcode projects that use this custom framework
In the first project, there is no problem, everything works perfectly
In the second project, I get a Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[** **:]: unrecognized selector sent to instance 0x101b02f90' when I am calling a method which is also called in the first project and which works perfectly in the first project
Both projects use the same custom iOS framework version and build
During the last two days, I have tried the followings:
Clean project > Clean build project > Rebuild project - Doesn't work
Rebuild the framework and add into the two projects - The issue still there
One thing that is very weird is that I have print the methods available in my frameworks in both projects according to this Stack Overflow, in the first project I have 130 methods available, in the second one I have only 72 methods available.
Is anyone have a clue of what happen?
Regards,
Jeremy
sry, I just saw you first question/answer now.
The main reason you need to do that is because of categories or other dynamic elements in static libraries. Objective C has Categories which are approximately the same as extensions in Swift, so you can extend classes/objects with additional methods.
In Objective C you can create a static library to link into you project. Without this flag however (-ObjC general of -force_load for a specific library) the symbols of Categories are not loaded outside of the library. I guess an original motivation was to use categories for internal stuff, so the default is not to load them. That also makes the binary a bit smaller. However many libraries actually add Categories (==Extension) they want to expose, so usually you need on of the flags.
Hope that helped a bit ^_^.
I finally find out what was causing the issue. I need to add -ObjC flag in "Other Linker Flags" in the Build Settings of the second project.
I don't understand why without this flag the framework has only 72 methods, and with the flags all the methods are available. Someone has an idea?

How to create framework with other frameworks and library dependency?

I know, there are so many same questions but I didn't get answer for my requirement.
First time I am creating framework. I have created test framework using Raywenderlich example. But my requirement is little bit different. I used so many different frameworks and also used SQLCipher in my project. Now, I want to convert this project into framework. I followed all the steps but the problem is occur when I am trying to build. Getting an error for SQLCypher because I didn’t add to my framework to avoid conflicts. Finally, I have added SQLCypher library to create build without error and it worked but now I am getting linker error when I am using that framework to test in testProject. I didn’t find any example with third parties. Please help me to solve this issue.
I had the same issue.
One solution is to change all method names of other frameworks or libs, but some lib is not open source.
Another solution is work for me which is to use cocoapods. But the user
who wants to use your framework will be forced using cocoapods, depending iOS 8.0 or above, depending the same version of 3rd libs. I have nothing to do with this restriction.
Seems the best way is do not depend 3rd libs in a framework.

Creating a Xamarin Binding project for PebbleKit iOS

For the past while I've been trying to create a binding project in Xamarin for PebbleKit iOS (the SDK for the Pebble smart watches). My hope is that in doing this I can create a Xamarin C# app that communicates with a Pebble smart watch, just like how you would in Objective - C.
Here is a link to the github page containing the code: https://github.com/dankunc/PebbleKit-Xamarin/tree/master
Also, here is a link to a simple harness project that just contains a button you can use to test out the binding project: https://github.com/dankunc/PebbleKit-Xamarin-Harness
Note: If any of you are kind enough to download the code and try it out, you'll probably need to update the reference path in the harness to the .dll in the binding project (PebbleKitAll/bin/release/PebbleKitAll.dll)
The project compiles, however when I go to use it in an actual Xamarin app, this code returns null to watch:
var watch = PBCentral.DefaultCentral();
In objective - c, the equivalent method would never return null, and I've been struggling with this for quite some time.
The PebbleKit binding project relies on two .frameworks from Pebble (PebbleKit and PebbleVendor) and a handful of other frameworks that get included in the harness project. I generated the ApiDefinition and StructsAndEnums files from using Objective Sharpie which I then cleaned up afterwards.
If anyone is able to help me with this, or if I need to provide more information or anything else, please let me know, and anything is appreciated. I've been struggling with this for quite a while and am at wits end. Thank you.

Resources