Skip to content

Commit

Permalink
Merge branch 'release/5.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed May 11, 2024
2 parents 45e779b + de28a67 commit c6ef745
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Android | **[LocalBroadcastManager](http://developer.android.com/reference/andro
## News
date | infos | refs
---- | ---- | ----
May 11, 2024 | fix [#67](https://github.com/bsorrentino/cordova-broadcaster/issues/67) - Receive broadcast data from external barcode scanner | Thanks to [lgl017](https://github.com/lgl017) and [kmitdebus](https://github.com/kmitdebus) for valuable feedbacks
Jul 19, 2023 | fix [#71](https://github.com/bsorrentino/cordova-broadcaster/pull/71) - Cannot find symbol "LocalBroadcastManager" | Thanks to [MrWeezle](https://github.com/MrWeezle) for valuable feedbacks
Jul 14, 2023 | Merge pull request [#70](https://github.com/bsorrentino/cordova-broadcaster/pull/70) - move to SDK 33 --> Android X. | Thank to [phyr0s](https://github.com/phyr0s) for contribution
Mar 19, 2020 | Concerning **Android** I've added support for **broadcast Intent to external Apps**, **receive broadcast Intents from external Apps**, **Flags & Category on Intent** | insipred by [navarrojava's fork](https://github.com/navarrojava/cordova-broadcaster/)
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-broadcaster",
"version": "5.1.0",
"version": "5.2.0",
"description": "Allow send message from Javascript to Native",
"cordova": {
"id": "cordova-plugin-broadcaster",
Expand All @@ -26,7 +26,7 @@
"2.3.0": {
"cordova-android": ">4.0.0"
},
"5.1.0": {
"5.2.0": {
"cordova-android": ">9.0.0"
}
}
Expand All @@ -39,9 +39,9 @@
"homepage": "https://github.com/bsorrentino/cordova-broadcaster#readme",
"devDependencies": {
"@types/cordova": "0.0.34",
"@types/node": "^13.9.2",
"auto-changelog": "^2.4.0",
"typescript": "^3.8.3"
"@types/node": "13.9.2",
"auto-changelog": "2.4.0",
"typescript": "3.8.3"
},
"scripts": {
"changelog": "auto-changelog -u",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="cordova-plugin-broadcaster"
version="5.1.0"
version="5.2.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<engines>
Expand Down
9 changes: 6 additions & 3 deletions www/broadcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ var Broadcaster = /** @class */ (function () {
Broadcaster.prototype.fireEvent = function (type, data) {
if (!this._channelExists(type))
return;
var event = document.createEvent('Event');
event.initEvent(type, false, false);
// const event = document.createEvent('Event');
// event.initEvent(type, false, false);
var event = new Event(type, { bubbles: false, cancelable: false });
if (data) {
event['data$'] = data; // fix #67
// for backward compatibility
for (var i in data) {
if (data.hasOwnProperty(i)) {
if (data.hasOwnProperty(i) && event[i] === undefined) {
event[i] = data[i];
}
}
Expand Down
11 changes: 7 additions & 4 deletions www/broadcaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ class Broadcaster {
{
if( !this._channelExists(type) ) return;

const event = document.createEvent('Event');
event.initEvent(type, false, false);
// const event = document.createEvent('Event');
// event.initEvent(type, false, false);
const event:any = new Event( type, { bubbles: false, cancelable: false})
if (data) {
event['data$'] = data // fix #67
// for backward compatibility
for (var i in data) {
if (data.hasOwnProperty(i)) {
(<any>event)[i] = (<any>data)[i];
if (data.hasOwnProperty(i) && event[i] === undefined ) {
event[i] = (<any>data)[i];
}
}
}
Expand Down

0 comments on commit c6ef745

Please sign in to comment.