From 5b94f6a1d3f8dace8673d6fee2beefb2e3510acf Mon Sep 17 00:00:00 2001 From: Damian Date: Fri, 6 Apr 2018 20:35:11 -0300 Subject: [PATCH 1/4] fixes`disconnectSession` method `disconnectSession` method of the OTSession class, return `Unknown error` fixes https://github.com/opentok/opentok-react-native/issues/11 --- src/OTSession.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OTSession.js b/src/OTSession.js index 2cecfe48..dddb6f2e 100644 --- a/src/OTSession.js +++ b/src/OTSession.js @@ -58,12 +58,12 @@ export default class OTSession extends Component { } disconnectSession() { OT.disconnectSession((disconnectError) => { - if (disconnectError) { + if (!disconnectError) { this.setState({ sessionInfo: null, }); } else { - handleError(error); + handleError(disconnectError); } }); } From 42861f35fc929cd7d2dd5f6f48f91b73d8981414 Mon Sep 17 00:00:00 2001 From: Manik Date: Mon, 9 Apr 2018 15:20:14 -0700 Subject: [PATCH 2/4] android/ --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6dce622c..e3044dd8 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ 5. Open XCode -6. Open .xcworkspace file in XCode. This file can be found in the `ios` folder. +6. Open `.xcworkspace` file in XCode. This file can be found in the `ios` folder of your React Native project. 7. Click `File` and `Add Files to` -8. Add the following files to the project: +8. Add the following files from `../node_modules/opentok-react-native/ios` to the project: * `OTPublisher.h` * `OTPublisher.m` * `OTPublisherManager.swift` @@ -70,10 +70,11 @@ * `OTSubscriber.m` * `OTSubscriberManager.swift` * `OTSubscriberView.swift` - * `-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?` +10. Add the contents from the `Bridging-Header.h` file in `../node_modules/opentok-react-native/ios` to `-Bridging-Header.h` + ### Android Installation 1. In you terminal, change into your project directory. From 81e65d6e5182240b5c1f05c36a91642f7cf2e51d Mon Sep 17 00:00:00 2001 From: Manik Date: Mon, 9 Apr 2018 15:20:52 -0700 Subject: [PATCH 3/4] improve installation for iOS and Android --- android/build.gradle | 6 ------ package.json | 3 +-- scripts/postInstall.js | 34 ---------------------------------- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 scripts/postInstall.js diff --git a/android/build.gradle b/android/build.gradle index a77bc7d4..87149a34 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,3 @@ - apply plugin: 'com.android.library' android { @@ -10,16 +9,11 @@ android { targetSdkVersion 23 versionCode 1 versionName "1.0" - ndk { - abiFilters "armeabi-v7a", "x86" - } } } dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules compile 'com.opentok.android:opentok-android-sdk:2.13.0' - compile 'com.android.volley:volley:1.1.0' } \ No newline at end of file diff --git a/package.json b/package.json index 9d446ea5..50a30b30 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "main": "src/index.js", "homepage": "www.tokbox.com", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "postinstall": "node ./scripts/postInstall" + "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "opentok", diff --git a/scripts/postInstall.js b/scripts/postInstall.js deleted file mode 100644 index 14922318..00000000 --- a/scripts/postInstall.js +++ /dev/null @@ -1,34 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const each = require('underscore').each; - -(function postInstall() { - console.log('running post install linking'); - const appName = require('../../../package.json').name; - const checkIOSBridingHeader = () => { - const iOSFiles = fs.readdirSync(`${__dirname}/../../../ios/`); - each(iOSFiles, file => { - if (file.includes('Bridging-Header.h')) { - return true; - } - }); - return false; - }; - const linkIOS = () => { - console.log('linking iOS files'); - const isBridge = checkIOSBridingHeader(); - const dirPath = path.join(__dirname, '../', 'ios'); - fs.readdir(dirPath, (err, files) => { - files.forEach(file => { - const fileContents = fs.readFileSync(`/${dirPath}/${file}`); - if (file === 'Bridging-Header.h' && isBridge === false) { - const bridgeName = `${appName}-${file}`; - fs.writeFileSync(`${__dirname}/../../../ios/${bridgeName}`, fileContents); - } else { - fs.writeFileSync(`${__dirname}/../../../ios/${file}`, fileContents); - } - }); - }); - }; - linkIOS(); -}()); From ee6cc5a913875066a9881929da3437bb5ae18ed1 Mon Sep 17 00:00:00 2001 From: Manik Date: Mon, 9 Apr 2018 15:44:39 -0700 Subject: [PATCH 4/4] bump version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71ac5dee..f3112ddf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "opentok-react-native", - "version": "0.3.4", + "version": "0.3.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 50a30b30..f475dc2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opentok-react-native", - "version": "0.3.4", + "version": "0.3.5", "description": "React Native components for OpenTok iOS and Android SDKs", "main": "src/index.js", "homepage": "www.tokbox.com",