Your cordova app sets socketURL:
connection.socketURL = 'https://domain.com:9001/';
Your cordova app has a file named as loadRTCMultiConnection.js. This file MUST be using same RTCMultiConnection distribution as the your web page.
Conclusion:
- Your cordova app MUST set
socketURL
parameter
- Your cordova app MUST be using same
RTCMultiConnection.js
Explanation:
socketURL
is used to access your socket.io server. Both cordova app and web-browsers are using same socket.io server.
Updated at Jan 03, 2017
To use Firebase in the RTCMultiConnection-cordova-apps:
- Open
index.html
and replace socket.io.js
with Firebase.js
- Add this script in the same index.html file:
<script src="js/globals.js"></script>
- Add this script in the same HTML file:
<script src="js/FirebaseConnection.js"></script>
- Opne index.js and add this line:
connection.setCustomSocketHandler(FirebaseConnection);
- As well as this line:
connection.firebase = 'webrtc-experiment';
To recap it:
<!-- index.html file -->
<script src="js/Firebase.js"></script>
<script src="js/globals.js"></script>
<script src="js/FirebaseConnection.js"></script>
and:
// index.js
var connection = new RTCMultiConnection();
connection.setCustomSocketHandler(FirebaseConnection);
connection.firebase = 'webrtc-experiment';
PS. You may need to modify config.xml to enable websocket or XHR_polling requests from firebase.com
. Simply replace rtcmulticonnection.herokuapp.com
with firebase.com
. E.g.
<?xml version='1.0' encoding='utf-8'?>
<widget>
<platform name="android">
<allow-navigation href="https://firebase.com/*" />
<allow-intent href="https://firebase.com/*" />
<access origin="https://firebase.com" />
</platform>
</widget>