bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
115 stars 53 forks source link

Failing to send broadcast from javascript to native #53

Closed iliadeviatov closed 4 years ago

iliadeviatov commented 4 years ago

Hi tried using the code snipper to send a broadcast from javascript to native with some data and the fireNativeEvent promise always resolves to error:

this.broadCaster .fireNativeEvent("com.service.print", { extras: { item: "test data" } }) .then((result) => { console.log("broadcast sent:" + result); }) .catch((error) => { console.log("Error sending broadcast:" + error); });

here is the original question on SO

iliadeviatov commented 4 years ago

Figured it out, added the answer on SO