Skip to content

Commit

Permalink
Merge pull request #184 from mark-veenstra/master
Browse files Browse the repository at this point in the history
Solved build errors for IOS
  • Loading branch information
Adam Ullman committed Jun 17, 2015
2 parents 4734ba1 + bbe3766 commit 9f863b6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
node_modules
opentok-ios-sdk-*
OpenTok-iOS-*
src/ios/OpenTok.framework
src/ios/OpenTok.framework
.idea/
32 changes: 19 additions & 13 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
target-dir="src/com/tokbox/cordova/" />

<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Expand Down Expand Up @@ -47,23 +46,30 @@
<header-file src="src/ios/OpenTokPlugin.h" />
<source-file src="src/ios/OpenTokPlugin.m" />

<framework src="libstdc++.dylib" />
<framework src="libc++.dylib" />
<framework src="libxml2.dylib" />
<framework src="libsqlite3.dylib" />
<framework src="libpthread.dylib" />
<framework src="VideoToolbox.framework" />
<framework src="src/ios/OpenTok.framework" custom="true" />
<framework src="Foundation.framework" />
<framework src="UIKit.framework" />
<framework src="AVFoundation.framework" />
<framework src="QuartzCore.framework" />
<framework src="OpenGLES.framework" />
<framework src="CoreVideo.framework" />
<framework src="AudioToolbox.framework" />
<framework src="Security.framework" />
<framework src="CoreData.framework" />
<framework src="AVFoundation.framework" />
<framework src="CoreGraphics.framework" />
<framework src="CoreMedia.framework" />
<framework src="CoreVideo.framework" />
<framework src="OpenGLES.framework" />
<framework src="SystemConfiguration.framework" />
<framework src="CFNetwork.framework" />
<framework src="CoreTelephony.framework" />
<framework src="libc++.dylib" />
<framework src="libz.dylib" />
<framework src="libsqlite3.dylib" />
<framework src="libxml2.dylib" />
<framework src="GLKit.framework" />
<framework src="EventKit.framework" />
<framework src="QuartzCore.framework" />
<framework src="MapKit.framework" />
<framework src="UIKit.framework" />
<framework src="Foundation.framework" />
<framework src="Security.framework" />
<framework src="CFNetwork.framework" />

<!-- Adopts project's config.xml to include the OpenTokPlugin and domain whitelists -->
<config-file target="config.xml" parent="/*/plugins">
Expand Down
44 changes: 26 additions & 18 deletions scripts/downloadiOSSDK.js
Original file line number Diff line number Diff line change
@@ -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.4.0.tar.bz2', './opentok-ios-sdk-2.4.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) {
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) {
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;
};

0 comments on commit 9f863b6

Please sign in to comment.