Skip to content

Commit

Permalink
Merge pull request #743 from opentok/develop
Browse files Browse the repository at this point in the history
v2.27.4
  • Loading branch information
jeffswartz authored Apr 29, 2024
2 parents 7d0d603 + 8b44b34 commit 0e8abb9
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 62 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2.27.4 (April 2024)

- [Update]: This version updates the Vonage Video iOS SDK version to 2.27.3. This version adds a [privacy manifest required by Apple's App store](https://developer.apple.com/support/third-party-SDK-requirements). Issue #737.

- [Update]: The installation instructions in the README file are updated, with new details on required Android permissions (such as `android.permission.BLUETOOTH`).

# 2.26.2 (April 2024)

- [Update]: This version updates the Vonage Video iOS SDK version to 2.26.3. This version adds a [privacy manifest required by Apple's App store](https://developer.apple.com/support/third-party-SDK-requirements). Issue #737.

# 2.25.5 (April 2024)
- [Update]: This version updates the Vonage Video iOS SDK version to 2.25.5. This version adds a [privacy manifest required by Apple's App store](https://developer.apple.com/support/third-party-SDK-requirements). Issue #737.

# 2.27.3 (March 2024)

- [Update]: This version updates the Vonage Video iOS SDK version to 2.27.2 and the Vonage Video Android SDK version to 2.27.1. See their release notes for details:
Expand Down
126 changes: 68 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,104 +8,114 @@ This library is now officially supported by Vonage.

In this repo, you'll find the OpenTok React Native library.

## Pre-Requisites:
## Prerequisites

1. Install [node.js](https://nodejs.org/)

2. Install and update [Xcode](https://developer.apple.com/xcode/) (you will need a Mac)
2. Install and update [Xcode](https://developer.apple.com/xcode/) (you will need a Mac). (See the React Native iOS installation [instructions](https://facebook.github.io/react-native/docs/getting-started.html).)

- React Native iOS installation [instructions](https://facebook.github.io/react-native/docs/getting-started.html)
3. Install and update [Android Studio](https://developer.android.com/studio/index.html). (See the React Native Android installation [instructions](https://facebook.github.io/react-native/docs/getting-started.html).)

3. Install and update [Android Studio](https://developer.android.com/studio/index.html)
## Installation

- React Native Android installation [instructions](https://facebook.github.io/react-native/docs/getting-started.html)
1. In your terminal, change into your React Native project's directory.

## Installation:
2. Add the library using `npm` or `yarn`:

1. In your terminal, change into your React Native project's directory
* `npm install opentok-react-native`
* `yarn add opentok-react-native`

2. Add the library using `npm` or `yarn`.
### iOS Installation

- `npm install opentok-react-native`
- `yarn add opentok-react-native`
1. Install the iOS pods:

### iOS Installation
```
npx pod-install
```

**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.
2. **For React Native versions prior to 0.60**:

1. In you terminal, change into the `ios` directory of your React Native project.
* Add this to your Podfile:

2. Create a pod file by running: `pod init`.
```
target '<YourProjectName>' do
# Pods for <YourProject>
pod 'OTXCFramework', '2.27.3'
end
```

* Run `react-native link opentok-react-native`.

**For React Native < 0.60**, add this to your Podfile:
These steps are not necessary in React Native version 0.60 and later.

```
target '<YourProjectName>' do
3. Ensure you have enabled both camera and microphone usage by adding the following entries to the `Info.plist` file:

# Pods for <YourProject>
pod 'OTXCFramework', '2.27.2'
end
```
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>
```

```
When you create an archive of your app, the [privacy manifest settings required by Apple's App store](https://developer.apple.com/support/third-party-SDK-requirements) are added automatically with this version of the OpenTok React Native SDK.

3. Now run, `pod install`
If you try to archive the app and it fails, please do the following:

1. Go to *Target*.

4. After installing the OpenTok iOS SDK, change into your root directory of your project.
2. Click *Build Phases*.

**For React Native < 0.60**, now run `react-native link opentok-react-native`.
3. Under the *Link Binary With Libraries* section, remove `libOpenTokReactNative.a` and add it again.

5. Open `<YourProjectName>.xcworkspace` contents in XCode. This file can be found in the `ios` folder of your React Native project.
### Android Installation

6. Click `File` and `New File`
1. In your terminal, change into your project directory.

7. Add an empty swift file to your project:
2. **For React Native versions prior to 0.60**:

- 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.
- Run `react-native link opentok-react-native`

8. Click `Create Bridging Header` when you're prompted with the following modal: `Would you like to configure an Objective-C bridging header?`
This step is not necessary in React Native version 0.60 and later.

9. Ensure you have enabled both camera and microphone usage by adding the following entries to your `Info.plist` file:
3. Run `bundle install`.

```
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>
```
4. Make sure the following in your app's gradle `compileSdkVersion`, `buildToolsVersion`, `minSdkVersion`, and `targetSdkVersion` are greater than or equal to versions specified in the OpenTok React Native library.

If you try to archive the app and it fails, please do the following:
5. For older Android devices, add the following permissions to the `AndroidManifest.xml` file:

1. Go to Target
2. Click on Build Phases
3. Under the Link Binary With Libraries section, remove the libOpenTokReactNative.a and add it again
* `android.permission.BLUETOOTH` -- The default audio device supports
Bluetooth audio. If your app does not use the default audio device and does not
use Bluetooth, you can remove this permission.

### Android Installation
* `android.permission.BLUETOOTH_CONNECT` -- You need to enable this for API level 31 and above. If you want
to use the Bluetooth device with Android SDK DefaultAudioDevice targeting API level 31 and above, please
ask for runtime permissions in the app or enable the ("Nearby devices/Bluetooth") permission manually in
the app settings.

1. In your terminal, change into your project directory.
* `android.permission.BROADCAST_STICKY` -- We have determined that this is unused by
the OpenTok Android SDK, and we will remove this permission from an upcoming release.

2. If you have already run `react-native link opentok-react-native` for the iOS installation, please skip this step.
* `android.permission.CAMERA` -- If your app does not use the default video capturer
and does not access the camera, you can remove this permission.

- Run `react-native link opentok-react-native`
* `android.permission.INTERNET` -- Required.

3. Open your Android project in Android Studio.
* `android.permission.MODIFY_AUDIO_SETTINGS` -- If your app does not use the default audio
device and does not access the microphone, you can remove this permission.

4. Sync Gradle
* `android.permission.READ_PHONE_STATE` -- The OpenTok Android SDK requests this permission in API level 22
and lower, and 31 and above.

5. Make sure the following in your app's gradle `compileSdkVersion`, `buildToolsVersion`, `minSdkVersion`, and `targetSdkVersion` are greater than or equal to versions specified in the OpenTok React Native library.
* `android.permission.RECORD_AUDIO` -- If your app does not use the default audio
device and does not access the microphone, you can remove this permission.

6. As for the older Android devices, ensure you add camera and audio permissions to your `AndroidManifest.xml` file:
For newer versions of Android — `API Level 23` (Android 6.0) and later — you do not need to add these to your app manifest. The OpenTok React Native SDK adds them automatically. However, if you use Android 21+, certain permissions require you to prompt the user.

```xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="true" />
```
Your app can remove any of these permissions that will not be required. See [this post](https://stackoverflow.com/a/31616472) and [this Android documentation](https://developer.android.com/studio/build/manifest-merge). For example, this removes the `android.permission.CAMERA` permission:

Newer versions of Android–`API Level 23` (Android 6.0)–have a different permissions model that is already handled by this library.
```
<uses-permission android:name="android.permission.CAMERA" tools:node="remove"/>
```

#### Bintray sunset

Expand Down
2 changes: 1 addition & 1 deletion opentok-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,swift}"

s.dependency 'React'
s.dependency 'OTXCFramework','2.27.2'
s.dependency 'OTXCFramework','2.27.3'
end
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opentok-react-native",
"version": "2.27.3",
"version": "2.27.4",
"description": "React Native components for OpenTok iOS and Android SDKs",
"main": "src/index.js",
"homepage": "https://www.tokbox.com",
Expand Down

0 comments on commit 0e8abb9

Please sign in to comment.