Skip to content

Commit

Permalink
Merge pull request #83 from opentok/ios-installation
Browse files Browse the repository at this point in the history
improve iOS installation
  • Loading branch information
Manik Sachdeva committed May 31, 2018
2 parents f69c5bc + 476b9a1 commit e73c74c
Show file tree
Hide file tree
Showing 18 changed files with 406 additions and 22 deletions.
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
node_modules/
*.DS_Store
*.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ React Native library for OpenTok iOS and Android SDKs

### iOS Installation

**Note** Please make sure to have [CocoaPods](https://cocoapods.org/) on your computer.
**Note:** Please make sure to have [CocoaPods](https://cocoapods.org/) on your computer.
If you've installed this package before, you may need to edit your `Podfile` and project structure because the installation process has changed.
1. In you terminal, change into your `ios` directory.

2. Create a pod file by running: `pod init`.
Expand All @@ -45,7 +46,6 @@ React Native library for OpenTok iOS and Android SDKs
platform :ios, '9.0'
target '<YourProjectName>' do
use_frameworks!
# Pods for <YourProject>
pod 'OpenTok'
Expand All @@ -55,31 +55,20 @@ React Native library for OpenTok iOS and Android SDKs

4. Now run, `pod install`

5. Open XCode
5. After installing the iOS SDK, change into your root directory of your project.

6. Open `<YourProjectName>.xcworkspace` file in XCode. This file can be found in the `ios` folder of your React Native project.
6. Now run, `react-native link opentok-react-native`.

7. Click `File` and `Add Files to`
7. Open `<YourProjectName>.xcworkspace` file in XCode. This file can be found in the `ios` folder of your React Native project.

8. Add the following files from `../node_modules/opentok-react-native/ios` to the project:
* `OTPublisher.h`
* `OTPublisher.m`
* `OTPublisherManager.swift`
* `OTPublisherView.swift`
* `OTRN.swift`
* `OTScreenCapturer.swift`
* `OTSessionManager.m`
* `OTSessionManager.swift`
* `OTSubscriber.h`
* `OTSubscriber.m`
* `OTSubscriberManager.swift`
* `OTSubscriberView.swift`
7. Click `File` and `New File`

9. Click `Create Bridging Header` when you're prompted with the following modal: `Would you like to configure an Objective-C bridging header?`
8. Add an empty swift file to your project:
* You can name this file anything i.e: `OTInstall.swift`. This is done to set some flags in XCode so the Swift code can be used.

10. Add the contents from the `Bridging-Header.h` file in `../node_modules/opentok-react-native/ios` to `<YourProjectName>-Bridging-Header.h`
9. Click `Create Bridging Header` when you're prompted with the following modal: `Would you like to configure an Objective-C bridging header?`

11. Ensure you have enabled both camera and microphone usage by adding the following entries to your `Info.plist` file:
10. Ensure you have enabled both camera and microphone usage by adding the following entries to your `Info.plist` file:

```
<key>NSCameraUsageDescription</key>
Expand Down
Loading

0 comments on commit e73c74c

Please sign in to comment.