I want to create an App communication with the MessagePort API between two of my Gear apps.
Based on the "Basic Project" template I have added some lines of code to open a LocalMessagePort
and a RemoteMessagePort
.
window.onload = function () {
var localMsgPort = tizen.messageport.requestLocalMessagePort('MessagePortA');
var remoteMsgPort = tizen.messageport.requestRemoteMessagePort('RKlH7XellU.Demo', 'MessagePortB');
var watchId = localMsgPort.addMessagePortListener(...);
};
But at runtime I get the following error:
TypeError: 'undefined' is not an object (evaluating 'tizen.messageport.requestLocalMessagePort')
Do I need any additional includes or something else?
Do I have to add more privileges or features in the config.xml
file?
Thanks in advance.