Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i able to use WebRTC in Swift Project ? #39

Open
indrajitsinh opened this issue Jun 7, 2016 · 11 comments
Open

Can i able to use WebRTC in Swift Project ? #39

indrajitsinh opened this issue Jun 7, 2016 · 11 comments

Comments

@indrajitsinh
Copy link

i am new to IOS development and i just recently learned swift programming language and i am not familiar with objective C

i know there is a feature called bridging header that allows you to use objective c code in Swift project
but as i am new hop someone suggest me what should i do ?

Thank you

@Xioshock
Copy link

I haven't tried this this project yet, but if you are targeting iOS 8+ and have updated CocoaPods, you don't need bridging header. Just type use_frameworks! at the top of your Podfile. It will create a framework from this library and you can then import it in your swift file, same as UIKit is imported

@SeanChenU
Copy link

I am using pod 0.39.0 and encountering this issue when pod install
The 'Pods-XXX-iOS' target has transitive dependencies that include static binaries: (/Users/User/XXX-ios/Pods/libjingle_peerconnection/libjingle_peerconnection/libWebRTC.a)

@coolwr
Copy link
Contributor

coolwr commented Jun 21, 2016

Yes, the project should work inside your Swift Project. However, because of the static library dependency you'll need to manually integrate into your project or create a framework per @Xioshock

The transitive dependency error seems to e an issue with the recent version of cocoa pods. We'll need to investigate this further to find a resolution.

@SeanChenU
Copy link

SeanChenU commented Jun 22, 2016

Here are my steps to integrate APPRTC into my project manually:

  1. Remove: pod 'APPRTC' and add them: pod 'libjingle_peerconnection' pod 'SocketRocket' in Podfile
  2. Copy from Lib/ folder from APPRTC project into my project
  3. Add these frameworks and libraries into project: "QuartzCore", "OpenGLES", "CoreGraphics", "CoreVideo", "CoreMedia", "CoreAudio", "AVFoundation", "AudioToolbox", "GLKit", "CFNetwork", "Security", "sqlite3", "stdc++.6", "icucore", "c++"
  4. Add related headers in my case #import <libjingle_peerconnection/RTCEAGLVideoView.h> #import "ARDAppClient.h" #import "RTCPeerConnectionFactory.h" into Bridging-Header.h
  5. Build!

@coolwr
Copy link
Contributor

coolwr commented Jun 22, 2016

Awesome. Thanks for posting the instructions! Would be great if someone could help investigate how to fix the transitive dependency error in cocoa pods so the integration would be easier.

@cmorell
Copy link

cmorell commented Aug 10, 2016

Hi! yes I also did the same like @SeanChenU but I really like how to add appRTC pod or how to create ones in order to has AppRTC client as a Pod and be usefull using swift project. Can anyone did it before?

I think I am closer (or not) but I get this error:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_RTCSessionDescription", referenced from:
      objc-class-ref in ARDSignalingMessage.o
      objc-class-ref in RTCSessionDescription+JSON.o
      l_OBJC_$_CATEGORY_RTCSessionDescription_$_JSON in RTCSessionDescription+JSON.o
  "_OBJC_CLASS_$_RTCICECandidate", referenced from:
      objc-class-ref in ARDSignalingMessage.o
      objc-class-ref in RTCICECandidate+JSON.o
      l_OBJC_$_CATEGORY_RTCICECandidate_$_JSON in RTCICECandidate+JSON.o
  "_OBJC_CLASS_$_RTCPair", referenced from:
      objc-class-ref in ARDAppClient.o
      objc-class-ref in RTCMediaConstraints+JSON.o
  "_OBJC_CLASS_$_RTCMediaConstraints", referenced from:
      objc-class-ref in ARDAppClient.o
      objc-class-ref in RTCMediaConstraints+JSON.o
      l_OBJC_$_CATEGORY_RTCMediaConstraints_$_JSON in RTCMediaConstraints+JSON.o
  "_OBJC_CLASS_$_RTCVideoCapturer", referenced from:
      objc-class-ref in ARDAppClient.o
  "_OBJC_CLASS_$_RTCICEServer", referenced from:
      objc-class-ref in ARDAppClient.o
      objc-class-ref in RTCICEServer+JSON.o
      l_OBJC_$_CATEGORY_RTCICEServer_$_JSON in RTCICEServer+JSON.o
  "_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
      objc-class-ref in ARDAppClient.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@saiteja7
Copy link

what is the meanning of 2nd step @SeanChenU

@cmorell
Copy link

cmorell commented Aug 18, 2016

@saiteja7 the meaning of 2nd step in @SeanChenU comment is that we need to copy in our project the classes that contains AppRTC/Lib folder:

ARDAppClient.(h/m)
ARDMessageResponse.(h/m)
ARDRegisterResponse.(h/m)
ARDSignalingMessage.(h/m)
ARDUtilities.(h/m)
ARDWebSocketChannel.(h/m)
RTCICECandidate+JSON.(h/m)
RTCICEServer+JSON.(h/m)
RTCMediaConstraints.(h/m)
RTCSessionDescription.(h/m)

@saiteja7
Copy link

okay thanq

On 18 August 2016 at 15:00, cmorell [email protected] wrote:

@saiteja7 https://github.com/saiteja7 the meaning of 2nd step in
@SeanChenU https://github.com/SeanChenU comment is that we need to copy
in our project the classes that contains AppRTC/Lib folder:

ARDAppClient.(h/m)
ARDMessageResponse.(h/m)
ARDRegisterResponse.(h/m)
ARDSignalingMessage.(h/m)
ARDUtilities.(h/m)
ARDWebSocketChannel.(h/m)
RTCICECandidate+JSON.(h/m)
RTCICEServer+JSON.(h/m)
RTCMediaConstraints.(h/m)
RTCSessionDescription.(h/m)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#39 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ATr_kL_hnRPp_GZXESw5ZGsd_BHfb4jiks5qhCYbgaJpZM4Iv2iT
.

@sonysum
Copy link

sonysum commented Sep 13, 2016

Hi,
@SeanChenU i follow your solution but i can not call renderFrame,
Ex: [self.localView renderFrame:nil]; // error class has no men=mber 'renderFrame'
any solution?

@Carlos77
Copy link

Carlos77 commented May 2, 2018

I have the same problem can i have more informations for how to solve this issues

WorkSpace/Test2/platforms/ios/Test2/Plugins/com.onsip.cordova/libwebrtc_base.a
Undefined symbols for architecture arm64:
"OBJC_CLASS$_RTCEAGLVideoView", referenced from:
objc-class-ref in PhoneRTCPlugin.o
"OBJC_CLASS$_RTCICEServer", referenced from:
objc-class-ref in PhoneRTCPlugin.o
"OBJC_CLASS$_RTCICECandidate", referenced from:
objc-class-ref in PhoneRTCDelegate.o
"OBJC_CLASS$_RTCMediaConstraints", referenced from:
objc-class-ref in PhoneRTCDelegate.o
"OBJC_CLASS$_RTCPair", referenced from:
objc-class-ref in PhoneRTCDelegate.o
"OBJC_CLASS$_RTCVideoCapturer", referenced from:
objc-class-ref in PhoneRTCDelegate.o
"OBJC_CLASS$_RTCSessionDescription", referenced from:
objc-class-ref in PhoneRTCDelegate.o
"OBJC_CLASS$_RTCPeerConnectionFactory", referenced from:
objc-class-ref in PhoneRTCDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants