{"id":13693458,"url":"https://github.com/ISBX/apprtc-ios","last_synced_at":"2025-05-02T21:32:22.207Z","repository":{"id":28305196,"uuid":"31817869","full_name":"ISBX/apprtc-ios","owner":"ISBX","description":"A native iOS video chat app based on WebRTC","archived":false,"fork":false,"pushed_at":"2019-12-03T00:43:28.000Z","size":61616,"stargazers_count":1349,"open_issues_count":117,"forks_count":412,"subscribers_count":80,"default_branch":"master","last_synced_at":"2025-04-08T08:12:17.215Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ISBX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-07T16:14:32.000Z","updated_at":"2025-04-07T02:14:49.000Z","dependencies_parsed_at":"2022-09-02T21:10:43.412Z","dependency_job_id":null,"html_url":"https://github.com/ISBX/apprtc-ios","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISBX%2Fapprtc-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISBX%2Fapprtc-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISBX%2Fapprtc-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISBX%2Fapprtc-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ISBX","download_url":"https://codeload.github.com/ISBX/apprtc-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252109066,"owners_count":21696185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T17:01:10.526Z","updated_at":"2025-05-02T21:32:17.197Z","avatar_url":"https://github.com/ISBX.png","language":"Objective-C","readme":"# AppRTC - iOS implementation of the Google WebRTC Demo\n\n## About\nThis Xcode project is a native wrapper for the Google's WebRTC Demo. It organizes the WebRTC components into a cocoa pod that can be easily deployed into any Xcode project. The precompiled libWebRTC static library bundled with the pod works with 64-bit apps, unlike prior versions of WebRTC projects where only the 32-bit version was available. Currently, the project is designed to run on iOS Devices (iOS Simulator is not supported).\n\nIncluded in this Xcode project is a native Storyboard based Room Locator and Video Chat View Controllers:\n\n![AppRTC - iOS WebRTC Client Pod](./screenshots/screenshots.jpg \"AppRTC iOS WebRTC App\")\n\n## Features\n* Fully native objective-c 64-bit support\n* pre-compiled libWebRTC.a (saves you hours of compiling)\n* Starting in v1.0.2 we are now referencing pod libjingle_peerconnection maintained by Pristine.io that has a an automated libWebRTC.a build process\n* Utilizes Cocoa Pod dependency management\n* View Controllers to easily drop into your own project\n* Exposed APIs to easily customize and adapt to your needs (see below for more details)\n* Supports the most recent https://apprtc.appspot.com (October 2015)\n* We also have a fork of the [Google AppRTC Web Server](https://github.com/ISBX/apprtc-server) that maintains full compatibility with this project\n\n## Notes\nThe following resources were useful in helping get this project to where it is today:\n* [How to get started with WebRTC and iOS without wasting 10 hours of your life](http://ninjanetic.com/how-to-get-started-with-webrtc-and-ios-without-wasting-10-hours-of-your-life/)\n* [hiroeorz's AppRTCDemo Project](https://github.com/hiroeorz/AppRTCDemo)\n* [Pristine.io Automated WebRTC Building](http://tech.pristine.io/automated-webrtc-building/)\n\n## Running the AppRTC App on your iOS Device\nTo run the app on your iPhone or iPad you can fork this repository and open the `AppRTC.xcworkspace` in Xcode and compile onto your iOS Device to check it out. By default the server address is set to https://apprtc.appspot.com.\n\n## Using the AppRTC Pod in your App\nIf you'd like to incorporate WebRTC Video Chat into your own application, you can install the AppRTC pod:\n```\npod install AppRTC\n```\nFrom there you can look at the `ARTCVideoChatViewController` class in this repo. The following steps below detail the specific changes you will need to make in your app to add Video Chat.\n#### Initialize SSL Peer Connection\nWebRTC can communicate securely over SSL. This is required if you want to test over https://apprtc.appspot.com. You'll need to modify your `AppDelegate.m` class with the following:\n\n1. Import the RTCPeerConnectionFactory.h\n ```\n#import \"RTCPeerConnectionFactory.h\"\n```\n\n2. Add the following to your `application:didFinishLaunchingWithOptions:` method:\n ```objective-c\n    [RTCPeerConnectionFactory initializeSSL];\n```\n\n3. Add the following to your `applicationWillTerminate:` method:\n ```objective-c\n    [RTCPeerConnectionFactory deinitializeSSL];\n```\n\n#### Add Video Chat\nTo add video chat to your app you will need 2 views:\n* Local Video View - Where the video is rendered from your device camera\n* Remote Video View - where the video is rendered for the remote camera\n\nTo do this, perform the following:\n\n1. In your ViewController or whatever class you are using that contains the 2 views defined above add the following headers imports:\n ```objective-c\n#import \u003clibjingle_peerconnection/RTCEAGLVideoView.h\u003e\n#import \u003cAppRTC/ARDAppClient.h\u003e\n```\n\n2. The class should implement the `ARDAppClientDelegate` and `RTCEAGLVideoViewDelegate` protocols:\n ```objective-c\n@interface ARTCVideoChatViewController : UIViewController \u003cARDAppClientDelegate, RTCEAGLVideoViewDelegate\u003e\n```\n    * `ARDAppClientDelegate` - Handles events when remote client connects and disconnect states. Also, handles events when local and remote video feeds are received.\n    * `RTCEAGLVideoViewDelegate` - Handles event for determining the video frame size.\n    \n3. Define the following properties in your class:\n ```objective-c\n@property (strong, nonatomic) ARDAppClient *client;\n@property (strong, nonatomic) IBOutlet RTCEAGLVideoView *remoteView;\n@property (strong, nonatomic) IBOutlet RTCEAGLVideoView *localView;\n@property (strong, nonatomic) RTCVideoTrack *localVideoTrack;\n@property (strong, nonatomic) RTCVideoTrack *remoteVideoTrack;\n```\n    * *ARDAppClient* - Performs the connection to the AppRTC Server and joins the chat room\n    * *remoteView* - Renders the Remote Video in the view\n    * *localView* - Renders the Local Video in the view\n    \n4. When initializing the the property variables make sure to set the delegates:\n ```objective-c\n    /* Initializes the ARDAppClient with the delegate assignment */\n    self.client = [[ARDAppClient alloc] initWithDelegate:self];\n    \n    /* RTCEAGLVideoViewDelegate provides notifications on video frame dimensions */\n    [self.remoteView setDelegate:self];\n    [self.localView setDelegate:self];\n```\n\n5. Connect to a Video Chat Room\n ```objective-c\n    [self.client setServerHostUrl:@\"https://apprtc.appspot.com\"];\n    [self.client connectToRoomWithId:@\"room123\" options:nil];\n```\n\n6. Handle the delegate methods for `ARDAppClientDelegate`\n ```objective-c\n- (void)appClient:(ARDAppClient *)client didChangeState:(ARDAppClientState)state {\n    switch (state) {\n        case kARDAppClientStateConnected:\n            NSLog(@\"Client connected.\");\n            break;\n        case kARDAppClientStateConnecting:\n            NSLog(@\"Client connecting.\");\n            break;\n        case kARDAppClientStateDisconnected:\n            NSLog(@\"Client disconnected.\");\n            [self remoteDisconnected];\n            break;\n    }\n}\n\n- (void)appClient:(ARDAppClient *)client didReceiveLocalVideoTrack:(RTCVideoTrack *)localVideoTrack {\n    self.localVideoTrack = localVideoTrack;\n    [self.localVideoTrack addRenderer:self.localView];\n}\n\n- (void)appClient:(ARDAppClient *)client didReceiveRemoteVideoTrack:(RTCVideoTrack *)remoteVideoTrack {\n    self.remoteVideoTrack = remoteVideoTrack;\n    [self.remoteVideoTrack addRenderer:self.remoteView];\n}\n\n- (void)appClient:(ARDAppClient *)client didError:(NSError *)error {\n    /* Handle the error */\n}\n```\n\n7. Handle the delegate callbacks for `RTCEAGLVideoViewDelegate`\n ```objective-c\n- (void)videoView:(RTCEAGLVideoView *)videoView didChangeVideoSize:(CGSize)size {\n /* resize self.localView or self.remoteView based on the size returned */\n}\n```\n\n\n## Contributing\nIf you'd like to contribute, please fork the repository and issue pull requests. If you have any special requests and want to collaborate, please contact me directly. Thanks!\n\n## Known Issues\nThe following are known issues that are being worked and should be released shortly:\n* When installing via CocoaPods in a swift project where you have `use_frameworks!` declared in your `PodFile` you may get the error message `transitive dependencies that include static binaries`. To resolve the issue you can add the following to your `PodFile`\n\n```\npre_install do |installer|\n    def installer.verify_no_static_framework_transitive_dependencies; end\nend\n```\n","funding_links":[],"categories":["Communication","Media","Objective-C","OOM-Leaks-Crash"],"sub_categories":["RTC"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FISBX%2Fapprtc-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FISBX%2Fapprtc-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FISBX%2Fapprtc-ios/lists"}