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

improve iOS installation #83

Merged
merged 5 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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