From 3c691378ab53940717341d5a106f4a8d2afc6b3e Mon Sep 17 00:00:00 2001 From: Mark Veenstra Date: Thu, 30 Apr 2015 16:53:06 +0200 Subject: [PATCH 1/2] Update to IOS SDK 2.5.0 --- .gitignore | 3 ++- scripts/downloadiOSSDK.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 04df4aba..5c11b2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules opentok-ios-sdk-* OpenTok-iOS-* -src/ios/OpenTok.framework \ No newline at end of file +src/ios/OpenTok.framework +.idea/ \ No newline at end of file diff --git a/scripts/downloadiOSSDK.js b/scripts/downloadiOSSDK.js index a4bf78da..ee444e92 100755 --- a/scripts/downloadiOSSDK.js +++ b/scripts/downloadiOSSDK.js @@ -6,13 +6,13 @@ module.exports = function (context) { Q = context.requireCordovaModule('q'), deferral = new Q.defer(); console.log('Downloading OpenTok iOS SDK'); - downloadFile('https://s3.amazonaws.com/artifact.tokbox.com/rel/ios-sdk/OpenTok-iOS-2.4.0.tar.bz2', './opentok-ios-sdk-2.4.0.tar.bz2', function (err) { + downloadFile('https://s3.amazonaws.com/artifact.tokbox.com/rel/ios-sdk/OpenTok-iOS-2.5.0.tar.bz2', './opentok-ios-sdk-2.5.0.tar.bz2', function (err) { if (!err) { console.log('downloaded'); - exec('tar -zxvf ./opentok-ios-sdk-2.4.0.tar.bz2', function (err, out, code) { + exec('tar -zxvf ./opentok-ios-sdk-2.5.0.tar.bz2', function (err, out, code) { console.log('expanded'); var frameworkDir = context.opts.plugin.dir + '/src/ios/'; - exec('mv ./OpenTok-iOS-2.4.0/OpenTok.framework ' + frameworkDir, function (err, out, code) { + exec('mv ./OpenTok-iOS-2.5.0/OpenTok.framework ' + frameworkDir, function (err, out, code) { console.log('moved OpenTok.framework into ' + frameworkDir); deferral.resolve(); }); From bbe3766c3f241c1f0c88b3681fe84dfcd0e4e256 Mon Sep 17 00:00:00 2001 From: Mark Veenstra Date: Tue, 16 Jun 2015 09:30:54 +0200 Subject: [PATCH 2/2] - Reverted IOS SDK to 2.4.0 - Added missing frameworks to plugin.xml to avoid build errors like "Undefined symbols for architecture armv7", see http://stackoverflow.com/questions/28775387/opentok-ios-v2-4-0-64-bit-undefined-symbols-for-architecture-armv7 - Updated script for downloading IOS SDK --- plugin.xml | 32 ++++++++++++++++------------ scripts/downloadiOSSDK.js | 44 +++++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/plugin.xml b/plugin.xml index a0de5419..0e8d831c 100644 --- a/plugin.xml +++ b/plugin.xml @@ -16,7 +16,6 @@ target-dir="src/com/tokbox/cordova/" /> - @@ -47,23 +46,30 @@ + + + + + + - - - - - - - + + + + + - - - - - + + + + + + + + diff --git a/scripts/downloadiOSSDK.js b/scripts/downloadiOSSDK.js index ee444e92..4714f773 100755 --- a/scripts/downloadiOSSDK.js +++ b/scripts/downloadiOSSDK.js @@ -1,23 +1,31 @@ #!/usr/bin/env node module.exports = function (context) { - var downloadFile = require('./downloadFile.js'), - exec = require('./exec/exec.js'), - Q = context.requireCordovaModule('q'), - deferral = new Q.defer(); - console.log('Downloading OpenTok iOS SDK'); - downloadFile('https://s3.amazonaws.com/artifact.tokbox.com/rel/ios-sdk/OpenTok-iOS-2.5.0.tar.bz2', './opentok-ios-sdk-2.5.0.tar.bz2', function (err) { - if (!err) { - console.log('downloaded'); - exec('tar -zxvf ./opentok-ios-sdk-2.5.0.tar.bz2', function (err, out, code) { - console.log('expanded'); - var frameworkDir = context.opts.plugin.dir + '/src/ios/'; - exec('mv ./OpenTok-iOS-2.5.0/OpenTok.framework ' + frameworkDir, function (err, out, code) { - console.log('moved OpenTok.framework into ' + frameworkDir); - deferral.resolve(); + var IosSDKVersion = "OpenTok-iOS-2.4.0"; + var downloadFile = require('./downloadFile.js'), + exec = require('./exec/exec.js'), + Q = context.requireCordovaModule('q'), + deferral = new Q.defer(); + console.log('Downloading OpenTok iOS SDK'); + downloadFile('https://s3.amazonaws.com/artifact.tokbox.com/rel/ios-sdk/' + IosSDKVersion + '.tar.bz2', + './' + IosSDKVersion + '.tar.bz2', function (err) { + if (!err) { + console.log('downloaded'); + exec('tar -zxvf ./' + IosSDKVersion + '.tar.bz2', function (err, out, code) { + console.log('expanded'); + var frameworkDir = context.opts.plugin.dir + '/src/ios/'; + exec('mv ./' + IosSDKVersion + '/OpenTok.framework ' + frameworkDir, function (err, out, code) { + console.log('moved OpenTok.framework into ' + frameworkDir); + exec('rm -r ./' + IosSDKVersion, function (err, out, code) { + console.log('Removed extracted dir'); + exec('rm ./' + IosSDKVersion + '.tar.bz2', function (err, out, code) { + console.log('Removed downloaded SDK'); + deferral.resolve(); + }); + }); + }); + }); + } }); - }); - } - }); - return deferral.promise; + return deferral.promise; }; \ No newline at end of file