MenuThis documentation explains how to generate iphone/ipad apps
RTCMultiConnection v3 supports cordova/ionic/phonegap (webviews).
For more information: docs/ios-android.md
Want to build Android apps? Check this: Write Android apps
| name | version |
|---|---|
| MacOSX | 10.11 or higher |
| xCode | 7.3 or higher |
| iOS | 9.2 or higher |
cordova requirements
Above command will/should display a result similar to this:
Apple OS X: installed darwin ---- OSX should be 10.11 or higher Xcode: installed 7.3 ---- 7.3 or higher ios-deploy: installed 1.8.4 ---- optional ios-sim: installed 5.0.6 ---- optional
Please make sure to re-install the prerequisites if you get different result.
cordova create RTCMultiConnection com.rtcmulticonnection.demo RTCMultiConnection cd RTCMultiConnection
Now you need to change following files:
<link type="text/css" href="css/index.css"> <script src="cordova.js"></script> <script src="js/socket.io.js"></script> <script src="js/RTCMultiConnection.js"></script> <script src="js/index.js"></script>
var app = {
initialize: function() {
app.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', app.onDeviceReady, false);
},
onDeviceReady: function() {
// here goes your real RTCMultiConnection codes
var connection = new RTCMultiConnection();
connection.socketURL = 'https://yourWebSite.com:9001/';
connection.openOrJoin('roomid');
}
};
app.initialize();
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.rtcmulticonnection.demo" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>RTCMultiConnection</name>
<icon src="www/img/icon.png" />
<content src="index.html" />
<platform name="ios">
<preference name="Orientation" value="all" />
<hook src="hooks/iosrtc-swift-support.js" type="after_platform_add" />
<config-file parent="CFBundleURLTypes" target="*-Info.plist">
<array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true />
</dict>
</array>
</config-file>
</platform>
<plugin name="cordova-plugin-whitelist" spec="latest" />
<plugin name="cordova-plugin-iosrtc" spec="latest" />
<plugin name="cordova-plugin-device" spec="latest" />
</widget>
Please modify following XML attributes:
| description | example code |
|---|---|
| "id" attribute: It should be something like this: |
<widget id="com.yourdomain"
|
| "name" attribute: Name should NOT have spaces or special characters. Consider it as a "username": |
<nameyourAppName</name |
| "icon" attribute: You can replace "icon.png" file with your own app-icon. | |
mkdir hooks cd hooks # wget http://webrtcweb.com/cordova-apps/video-conferencing/hooks/iosrtc-swift-support.js wget https://raw.githubusercontent.com/eface2face/cordova-plugin-iosrtc/master/extra/hooks/iosrtc-swift-support.js [sudo] chmod +x iosrtc-swift-support.js
cordova platform add ios
platforms/ios/ProjectName.xcodeproj
You need to validate your iOS profile/email.
Using xCode, goto "info.plist" section and you MUST add following two entries:
| Add "Privacy - Microphone" entry |
| Add "Privacy - Camera" entry |
cordova build ios
Now click "Run" button on xCode to compile the iOS app and install on your real iPhone/iPad device. Please do NOT use emulators.
(Use USB cable) Plugin your iPhone (6p or 7) device to your MacBook
Open XCode and click "Generic iOS Device" from the tool-bar
Select your real iPhone device
Click "Run" button from the same tool-bar
It will generate iOS app, automatically install it on your real iPhone device and automatically open it as well.