0

I'm trying to use the PhoneRTC plugin on my Ionic project. I've followed this guide, but everything stops when calling:

var session = new cordova.plugins.phonertc.Session(config); There are no errors, it just stops.

Code:

function call(isInitiator, peer_id) {
    console.log('Før config...');
    var config = {
        isInitiator : isInitiator,
        turn : {
            host : 'turn:<url>'
        },
        stream : {
            audio : true,
            video : false
        }
    };
    console.log('Before');
    //Initiate call
    var session = new cordova.plugins.phonertc.Session(config);
    console.log('After');
    session.on('sendMessage', function(data) {
        SocketService.emit('sendMessage', {
        id : $scope.id,
        peer_id : $scope.peer_id,
        type : 'phonertc_handshake',
        data : JSON.stringify(data)
    });
});

Logcat:

I/chromium(12959): [INFO:CONSOLE(57)] "Before", source: file:///android_asset/www/callController.js (57)
I/chromium(12959): [INFO:CONSOLE(21162)] "[object Object]", source: file:///android_asset/www/lib/ionic/js/ionic.bundle.js (21162)</code>

Do anyone have an idea of what is wrong?

(The plugin is referred in platform/android/res/config.xml)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Kriss
  • 21
  • 3
  • I've never used this plugin but i've experienced issues with other things where I wasn't getting a callback or an error and it turned out I was missing a URL off the whitelist in the `config.xml`. Does this plugin need to whitelist a server or some URL do you think? – Will.Harris Dec 18 '15 at 15:01
  • I don't think I have to whitelist any servers. The plugin connects to my own node server (socket.io), and my own turn server. Here is the only reference to PhoneRTC in platform/android/res/xml/config.xml: – Kriss Dec 21 '15 at 11:37
  • And this is the CSP I'm using: – Kriss Dec 21 '15 at 12:08
  • My config was wrong. It should be 'streams', not 'stream'. My bad! – Kriss Dec 21 '15 at 15:36

0 Answers0