Broadcast event from native app to web app


I have native service app and a web app. In that I’m trying to send telephone call status from native service app to web app using “Event Broadcast & Subscription” (

  1. Native code for broadcasting event:
    bool SendEvent(bundle *msg) {
    if (!msg) return false;
    int ret = event_publish_app_event(“”, msg);
    if (ret == EVENT_ERROR_NONE) {
    LOG_INFO(“Event sent successfully”);
    } else {
    LOG_ERROR(“Failed to send event: %d”, ret);
    return (ret == EVENT_ERROR_NONE);

I have tested this code with another native application and it’s working fine.

  1. To receive event on web app I’m using “addEventListener”. (
    Web App event listener code:
    var listener;
    var app = tizen.application.getCurrentApplication();

function onEvent(event, data) {
console.log(“Received data:” + JSON.stringify(data));

function listenToEvent(){
var appEvent = { appId: “com.test.service”, name: ‘call_status_event’ };
try {
listener = app.addEventListener(appEvent, onEvent);
} catch (e) {

In this code, no matter what I pass as appId, it always throws “Invalid appId” error.
How do we fix it?

I think you need to build multi package first,

Thanks for suggestion, but I can’t use multi package.
B’coz service app uses MDM apis and If I create multi package, KPE Licence won’t allow to associate package (.wgt) with the key.