# webRTC phoneGap plugin using Licode as signalling server

**URL:** <https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279>\
**Category:** Uncategorized\
**Created:** [June 18, 2014, 10:42am UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279 "2014-06-18T10:42:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simina\_Dorin](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Simina\_Dorin](https://discourse.lynckia.com/u/Simina_Dorin)\
**Post date:** [June 18, 2014, 10:42am UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/1 "2014-06-18T10:42:40Z")

</div>

Hi,

I have an up and running Licode environment and starting from the PhoneRTC  
github project I’ve developed a similar phoneGap iOS native plugin.

> **[alongubkin/phonertc](https://github.com/alongubkin/phonertc)**
>
> WebRTC for Cordova apps - No longer active. Contribute to alongubkin/phonertc development by creating an account on GitHub.

The developed functionality was tested using [apprtc.appspot.com](http://apprtc.appspot.com) and  
google’s mechanism for TURN and signalling servers.

If I want to use Licode environment instead [apprtc.appspot.com](http://apprtc.appspot.com), what  
changes should I perform in my javascript code in order to get the  
signalling server?  
At top level the plugin usage is:

phonertc.call({  
isInitator: true, // Caller or callee?  
turn: {  
host: ‘turn:turn.example.com:3478’,  
username: ‘user’,  
password: ‘pass’  
},  
sendMessageCallback: function (data) {  
// PhoneRTC wants to send a message to your target, use  
// your signaling server here to send the message.  
signaling.sendMessage(target, {  
type: ‘webrtc\_handshake’,  
data: data  
});  
},  
answerCallback: function () {  
alert(‘Callee answered!’);  
},  
disconnectCallback: function () {  
alert(‘Call disconnected!’);  
}});  
signaling.onMessage = function (message) {  
if (message.type === ‘webrtc\_handshake’) {  
// when a message is received from the signaling server,  
// notify the PhoneRTC plugin.  
phonertc.receiveMessage(message.data);  
}};

In this case signalling represent the signalling server and I don’t know how to instantiate it using Licode.

Best regards,

Dorin

---

<div class="post-metadata">

**Author:** ![Yannick\_Modah\_Gouez](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@Yannick\_Modah\_Gouez](https://discourse.lynckia.com/u/Yannick_Modah_Gouez)\
**Post date:** [August 29, 2014, 1:59pm UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/2 "2014-08-29T13:59:03Z")

</div>

Hi guys,

I will be working on this subject in the next weeks. Any progress on your  
side ?On Thursday, July 10, 2014 1:32:00 PM UTC+2, Geoffry Nagy wrote:

> Hi Simina,
> 
> we are currently investigating the possibility to run Licode inside a  
> Phonegap application for Android.  
> It would be nice if you could share your findings with your project, it  
> looks really interesting!
> 
> On Wednesday, June 18, 2014 12:42:40 PM UTC+2, Simina Dorin wrote:
> 
> > Hi,
> > 
> > I have an up and running Licode environment and starting from the  
> > PhoneRTC github project I’ve developed a similar phoneGap iOS native plugin.  
> > [GitHub - alongubkin/phonertc: WebRTC for Cordova apps - No longer active](https://github.com/alongubkin/phonertc)
> > 
> > The developed functionality was tested using [apprtc.appspot.com](http://apprtc.appspot.com) and  
> > google’s mechanism for TURN and signalling servers.
> > 
> > If I want to use Licode environment instead [apprtc.appspot.com](http://apprtc.appspot.com), what  
> > changes should I perform in my javascript code in order to get the  
> > signalling server?  
> > At top level the plugin usage is:
> > 
> > phonertc.call({  
> > isInitator: true, // Caller or callee?  
> > turn: {  
> > host: ‘turn:turn.example.com:3478’,  
> > username: ‘user’,  
> > password: ‘pass’  
> > },  
> > sendMessageCallback: function (data) {  
> > // PhoneRTC wants to send a message to your target, use  
> > // your signaling server here to send the message.  
> > signaling.sendMessage(target, {  
> > type: ‘webrtc\_handshake’,  
> > data: data  
> > });  
> > },  
> > answerCallback: function () {  
> > alert(‘Callee answered!’);  
> > },  
> > disconnectCallback: function () {  
> > alert(‘Call disconnected!’);  
> > }});  
> > signaling.onMessage = function (message) {  
> > if (message.type === ‘webrtc\_handshake’) {  
> > // when a message is received from the signaling server,  
> > // notify the PhoneRTC plugin.  
> > phonertc.receiveMessage(message.data);  
> > }};
> > 
> > In this case signalling represent the signalling server and I don’t know how to instantiate it using Licode.
> > 
> > Best regards,
> > 
> > Dorin

---

<div class="post-metadata">

**Author:** ![Geoffry\_Nagy](https://avatars.discourse-cdn.com/v4/letter/g/9f8e36/32.png) [@Geoffry\_Nagy](https://discourse.lynckia.com/u/Geoffry_Nagy)\
**Post date:** [August 29, 2014, 2:25pm UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/3 "2014-08-29T14:25:38Z")

</div>

Hi,

we are currently using Licode in a Cordova app. We haven’t developed any  
plugin for this.  
To access the camera, we use the crosswalk project. This implements a  
chrome webview to work in, instead of the default android webview.On Friday, August 29, 2014 3:59:03 PM UTC+2, Yannick Modah Gouez wrote:

> Hi guys,
> 
> I will be working on this subject in the next weeks. Any progress on your  
> side ?
> 
> On Thursday, July 10, 2014 1:32:00 PM UTC+2, Geoffry Nagy wrote:
> 
> > Hi Simina,
> > 
> > we are currently investigating the possibility to run Licode inside a  
> > Phonegap application for Android.  
> > It would be nice if you could share your findings with your project, it  
> > looks really interesting!
> > 
> > On Wednesday, June 18, 2014 12:42:40 PM UTC+2, Simina Dorin wrote:
> > 
> > > Hi,
> > > 
> > > I have an up and running Licode environment and starting from the  
> > > PhoneRTC github project I’ve developed a similar phoneGap iOS native plugin.  
> > > [GitHub - alongubkin/phonertc: WebRTC for Cordova apps - No longer active](https://github.com/alongubkin/phonertc)
> > > 
> > > The developed functionality was tested using [apprtc.appspot.com](http://apprtc.appspot.com) and  
> > > google’s mechanism for TURN and signalling servers.
> > > 
> > > If I want to use Licode environment instead [apprtc.appspot.com](http://apprtc.appspot.com), what  
> > > changes should I perform in my javascript code in order to get the  
> > > signalling server?  
> > > At top level the plugin usage is:
> > > 
> > > phonertc.call({  
> > > isInitator: true, // Caller or callee?  
> > > turn: {  
> > > host: ‘turn:turn.example.com:3478’,  
> > > username: ‘user’,  
> > > password: ‘pass’  
> > > },  
> > > sendMessageCallback: function (data) {  
> > > // PhoneRTC wants to send a message to your target, use  
> > > // your signaling server here to send the message.  
> > > signaling.sendMessage(target, {  
> > > type: ‘webrtc\_handshake’,  
> > > data: data  
> > > });  
> > > },  
> > > answerCallback: function () {  
> > > alert(‘Callee answered!’);  
> > > },  
> > > disconnectCallback: function () {  
> > > alert(‘Call disconnected!’);  
> > > }});  
> > > signaling.onMessage = function (message) {  
> > > if (message.type === ‘webrtc\_handshake’) {  
> > > // when a message is received from the signaling server,  
> > > // notify the PhoneRTC plugin.  
> > > phonertc.receiveMessage(message.data);  
> > > }};
> > > 
> > > In this case signalling represent the signalling server and I don’t know how to instantiate it using Licode.
> > > 
> > > Best regards,
> > > 
> > > Dorin

---

<div class="post-metadata">

**Author:** ![Geoffry\_Nagy](https://avatars.discourse-cdn.com/v4/letter/g/9f8e36/32.png) [@Geoffry\_Nagy](https://discourse.lynckia.com/u/Geoffry_Nagy)\
**Post date:** [July 10, 2014, 11:32am UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/4 "2014-07-10T11:32:00Z")

</div>

Hi Simina,

we are currently investigating the possibility to run Licode inside a  
Phonegap application for Android.  
It would be nice if you could share your findings with your project, it  
looks really interesting!On Wednesday, June 18, 2014 12:42:40 PM UTC+2, Simina Dorin wrote:

> Hi,
> 
> I have an up and running Licode environment and starting from the PhoneRTC  
> github project I’ve developed a similar phoneGap iOS native plugin.  
> [GitHub - alongubkin/phonertc: WebRTC for Cordova apps - No longer active](https://github.com/alongubkin/phonertc)
> 
> The developed functionality was tested using [apprtc.appspot.com](http://apprtc.appspot.com) and  
> google’s mechanism for TURN and signalling servers.
> 
> If I want to use Licode environment instead [apprtc.appspot.com](http://apprtc.appspot.com), what  
> changes should I perform in my javascript code in order to get the  
> signalling server?  
> At top level the plugin usage is:
> 
> phonertc.call({  
> isInitator: true, // Caller or callee?  
> turn: {  
> host: ‘turn:turn.example.com:3478’,  
> username: ‘user’,  
> password: ‘pass’  
> },  
> sendMessageCallback: function (data) {  
> // PhoneRTC wants to send a message to your target, use  
> // your signaling server here to send the message.  
> signaling.sendMessage(target, {  
> type: ‘webrtc\_handshake’,  
> data: data  
> });  
> },  
> answerCallback: function () {  
> alert(‘Callee answered!’);  
> },  
> disconnectCallback: function () {  
> alert(‘Call disconnected!’);  
> }});  
> signaling.onMessage = function (message) {  
> if (message.type === ‘webrtc\_handshake’) {  
> // when a message is received from the signaling server,  
> // notify the PhoneRTC plugin.  
> phonertc.receiveMessage(message.data);  
> }};
> 
> In this case signalling represent the signalling server and I don’t know how to instantiate it using Licode.
> 
> Best regards,
> 
> Dorin

---

<div class="post-metadata">

**Author:** ![Geoffry\_Nagy](https://avatars.discourse-cdn.com/v4/letter/g/9f8e36/32.png) [@Geoffry\_Nagy](https://discourse.lynckia.com/u/Geoffry_Nagy)\
**Post date:** [August 29, 2014, 3:38pm UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/5 "2014-08-29T15:38:13Z")

</div>

Hi Yannick,

that’s right, currently our focus is on Android only.  
iOS is on the roadmap but with iOS deliberately hitting the brake for HTML5  
based apps, I have little confidence for iOS.On Friday, August 29, 2014 5:00:53 PM UTC+2, Yannick Modah Gouez wrote:

> Oh this means you’re building for android only ?
> 
> Did you try to have something working with ios ?
> 
> On Friday, August 29, 2014 4:25:39 PM UTC+2, Geoffry Nagy wrote:
> 
> > Hi,
> > 
> > we are currently using Licode in a Cordova app. We haven’t developed any  
> > plugin for this.  
> > To access the camera, we use the crosswalk project. This implements a  
> > chrome webview to work in, instead of the default android webview.

---

<div class="post-metadata">

**Author:** ![Alvaro\_Alonso1](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Alvaro\_Alonso1](https://discourse.lynckia.com/u/Alvaro_Alonso1)\
**Post date:** [July 8, 2014, 9:43am UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/6 "2014-07-08T09:43:08Z")

</div>

Hi,

the signaling is totally wrapped by client API of licode. Here (  
[licode/extras/basic\_example/public/script.js at master · lynckia/licode · GitHub](https://github.com/ging/licode/blob/master/extras/basic_example/public/script.js))  
you will find our basic example demo in which every client that connects to  
a room publish its stream and subscribe to others. As you can see the  
signaling is implicit in publish and subscribe methods.

I hope this helps.

BR2014-06-18 12:42 GMT+02:00 Simina Dorin [dorin.simina@gmail.com](mailto:dorin.simina@gmail.com):

> Hi,
> 
> I have an up and running Licode environment and starting from the PhoneRTC  
> github project I’ve developed a similar phoneGap iOS native plugin.  
> [GitHub - alongubkin/phonertc: WebRTC for Cordova apps - No longer active](https://github.com/alongubkin/phonertc)
> 
> The developed functionality was tested using [apprtc.appspot.com](http://apprtc.appspot.com) and  
> google’s mechanism for TURN and signalling servers.
> 
> If I want to use Licode environment instead [apprtc.appspot.com](http://apprtc.appspot.com), what  
> changes should I perform in my javascript code in order to get the  
> signalling server?  
> At top level the plugin usage is:
> 
> phonertc.call({  
> isInitator: true, // Caller or callee?  
> turn: {  
> host: ‘turn:turn.example.com:3478’,  
> username: ‘user’,  
> password: ‘pass’  
> },  
> sendMessageCallback: function (data) {  
> // PhoneRTC wants to send a message to your target, use  
> // your signaling server here to send the message.  
> signaling.sendMessage(target, {  
> type: ‘webrtc\_handshake’,  
> data: data  
> });  
> },  
> answerCallback: function () {  
> alert(‘Callee answered!’);  
> },  
> disconnectCallback: function () {  
> alert(‘Call disconnected!’);  
> }});  
> signaling.onMessage = function (message) {  
> if (message.type === ‘webrtc\_handshake’) {  
> // when a message is received from the signaling server,  
> // notify the PhoneRTC plugin.  
> phonertc.receiveMessage(message.data);  
> }};
> 
> In this case signalling represent the signalling server and I don’t know how to instantiate it using Licode.
> 
> Best regards,
> 
> Dorin
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “lynckia” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## –

Álvaro

---

<div class="post-metadata">

**Author:** ![Yannick\_Modah\_Gouez](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@Yannick\_Modah\_Gouez](https://discourse.lynckia.com/u/Yannick_Modah_Gouez)\
**Post date:** [August 29, 2014, 3:00pm UTC](https://discourse.lynckia.com/t/webrtc-phonegap-plugin-using-licode-as-signalling-server/279/7 "2014-08-29T15:00:53Z")

</div>

Oh this means you’re building for android only ?

Did you try to have something working with ios ?On Friday, August 29, 2014 4:25:39 PM UTC+2, Geoffry Nagy wrote:

> Hi,
> 
> we are currently using Licode in a Cordova app. We haven’t developed any  
> plugin for this.  
> To access the camera, we use the crosswalk project. This implements a  
> chrome webview to work in, instead of the default android webview.
