Skip to content

Commit

Permalink
Merge pull request #372 from opentok/0.12.2
Browse files Browse the repository at this point in the history
0.12.2 to master
  • Loading branch information
ggoldens authored Dec 6, 2019
2 parents 6a1313f + e8fcef4 commit 3c32276
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 68 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

# 0.12.2 (Dec 4, 2019)

- **[Fix]**: Prevent to unpublish on disconnected sessions (merged from [PR356](https://github.com/opentok/opentok-react-native/pull/356)). Adheres to: [#337](https://github.com/opentok/opentok-react-native/issues/337)
- **[Feature]**: Add podspec for autolinking support in RN 0.6x (merged from [PR358](https://github.com/opentok/opentok-react-native/pull/358)). Adheres to: [#332](https://github.com/opentok/opentok-react-native/issues/332)
- Android SDK updated to `2.16.3`

# 0.12.1 (Aug 30, 2019)

- **[Fix]**: Fix an error when updating streamId for subscriber component (merged from [PR326](https://github.com/opentok/opentok-react-native/pull/326)). Adheres to: [#315](https://github.com/opentok/opentok-react-native/issues/315), [#324](https://github.com/opentok/opentok-react-native/issues/324)
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you've installed this package before, you may need to edit your `Podfile` and

2. Create a pod file by running: `pod init`.

3. Add the following to your pod file:
**For React Native < 0.60**, add this to your Podfile:

```
target '<YourProjectName>' do
Expand All @@ -54,22 +54,22 @@ If you've installed this package before, you may need to edit your `Podfile` and
```

4. Now run, `pod install`
3. Now run, `pod install`

5. After installing the OpenTok iOS SDK, change into your root directory of your project.
4. After installing the OpenTok iOS SDK, change into your root directory of your project.

6. Now run, `react-native link opentok-react-native`.
**For React Native < 0.60**, now run `react-native link opentok-react-native`.

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

7. Click `File` and `New File`
6. Click `File` and `New File`

8. Add an empty swift file to your project:
7. 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.

9. Click `Create Bridging Header` when you're prompted with the following modal: `Would you like to configure an Objective-C bridging header?`
8. Click `Create Bridging Header` when you're prompted with the following modal: `Would you like to configure an Objective-C bridging header?`

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

```
<key>NSCameraUsageDescription</key>
Expand All @@ -82,7 +82,7 @@ If you try to archive the app and it fails, please do the following:

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
3. Under the Link Binary With Libraries section, remove the libOpenTokReactNative.a and add it again

### Android Installation

Expand All @@ -93,7 +93,7 @@ If you try to archive the app and it fails, please do the following:

3. Open your Android project in Android Studio.

4. Add the following to your project `build.gradle` file:
4. Add the following to your project `build.gradle` file:

```
maven {
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:${_reactNativeVersion}" // From node_modules
implementation 'com.opentok.android:opentok-android-sdk:2.16.1'
implementation 'com.opentok.android:opentok-android-sdk:2.16.3'
}
4 changes: 0 additions & 4 deletions ios/OpenTokReactNative.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
9C6F95C520ACE90E00FEAD68 /* OTPublisherManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTPublisherManager.swift; sourceTree = "<group>"; };
9C6F95C620ACE90E00FEAD68 /* OTSessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTSessionManager.swift; sourceTree = "<group>"; };
9C6F95C720ACE90E00FEAD68 /* OTSubscriberView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTSubscriberView.swift; sourceTree = "<group>"; };
9C6F95C820ACE90E00FEAD68 /* OTSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTSubscriber.h; sourceTree = "<group>"; };
9C6F95CA20ACE90E00FEAD68 /* OTPublisher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTPublisher.h; sourceTree = "<group>"; };
9C6F95CB20ACE90E00FEAD68 /* OTRN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTRN.swift; sourceTree = "<group>"; };
9C6F95CC20ACE90E00FEAD68 /* OTPublisher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTPublisher.m; sourceTree = "<group>"; };
9C86849C218E2B5A004679BA /* EventUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventUtils.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -89,14 +87,12 @@
isa = PBXGroup;
children = (
9C86849B218E2B31004679BA /* Utils */,
9C6F95CA20ACE90E00FEAD68 /* OTPublisher.h */,
9C6F95CC20ACE90E00FEAD68 /* OTPublisher.m */,
9C6F95C520ACE90E00FEAD68 /* OTPublisherManager.swift */,
9C6F95C320ACE90E00FEAD68 /* OTPublisherView.swift */,
9C6F95CB20ACE90E00FEAD68 /* OTRN.swift */,
9C6F95C120ACE90D00FEAD68 /* OTSessionManager.m */,
9C6F95C620ACE90E00FEAD68 /* OTSessionManager.swift */,
9C6F95C820ACE90E00FEAD68 /* OTSubscriber.h */,
9C6F95C420ACE90E00FEAD68 /* OTSubscriber.m */,
9C6F95C220ACE90D00FEAD68 /* OTSubscriberManager.swift */,
9C6F95C720ACE90E00FEAD68 /* OTSubscriberView.swift */,
Expand Down
17 changes: 0 additions & 17 deletions ios/OpenTokReactNative/OTPublisher.h

This file was deleted.

1 change: 0 additions & 1 deletion ios/OpenTokReactNative/OTPublisher.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <Foundation/Foundation.h>
#import "OTPublisher.h"
#import <React/RCTViewManager.h>

@interface RCT_EXTERN_MODULE(OTPublisherSwift, RCTViewManager)
Expand Down
21 changes: 9 additions & 12 deletions ios/OpenTokReactNative/OTSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,15 @@ class OTSessionManager: RCTEventEmitter {
var error: OTError?
if let isPublishing = OTRN.sharedState.isPublishing[publisherId] {
if (isPublishing) {
guard let sessionId = publisher.session?.sessionId else {
let errorInfo = EventUtils.createErrorMessage("Error destroying publisher. Could not find sessionId")
callback([errorInfo]);
return
}
guard let session = OTRN.sharedState.sessions[sessionId] else {
let errorInfo = EventUtils.createErrorMessage("Error destroying publisher. Could not find native session instance")
callback([errorInfo]);
return
}
if (session.sessionConnectionStatus.rawValue == 1) {
session.unpublish(publisher, error: &error)
if let sessionId = publisher.session?.sessionId {
guard let session = OTRN.sharedState.sessions[sessionId] else {
let errorInfo = EventUtils.createErrorMessage("Error destroying publisher. Could not find native session instance")
callback([errorInfo]);
return
}
if (session.sessionConnectionStatus.rawValue == 1) {
session.unpublish(publisher, error: &error)
}
}
}
}
Expand Down
18 changes: 0 additions & 18 deletions ios/OpenTokReactNative/OTSubscriber.h

This file was deleted.

1 change: 0 additions & 1 deletion ios/OpenTokReactNative/OTSubscriber.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import <Foundation/Foundation.h>
#import "OTSubscriber.h"
#import <React/RCTViewManager.h>

@interface RCT_EXTERN_MODULE(OTSubscriberSwift, RCTViewManager)
Expand Down
21 changes: 21 additions & 0 deletions opentok-react-native.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.license = package['license']

s.authors = package['author']
s.homepage = package['homepage']
s.platform = :ios, "9.0"
s.swift_version = "4.2"

s.source = { :git => "https://github.com/opentok/opentok-react-native.git", :tag => "v#{s.version}" }
s.source_files = "ios/**/*.{h,m,swift}"

s.dependency 'React'
s.dependency 'OpenTok'
end
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "opentok-react-native",
"version": "0.12.1",
"version": "0.12.2",
"description": "React Native components for OpenTok iOS and Android SDKs",
"main": "src/index.js",
"homepage": "www.tokbox.com",
"homepage": "https://www.tokbox.com",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down

0 comments on commit 3c32276

Please sign in to comment.