Skip to content

Commit

Permalink
Merge branch 'release/5.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Nov 22, 2024
2 parents fa55dd3 + 533413f commit b3c8dd6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-broadcaster",
"version": "5.2.0",
"version": "5.3.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.2.0": {
"5.3.0": {
"cordova-android": ">9.0.0"
}
}
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.2.0"
version="5.3.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<engines>
Expand Down
7 changes: 6 additions & 1 deletion src/android/CDVBroadcaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.util.Log;
Expand Down Expand Up @@ -157,7 +158,11 @@ public void run() {
protected void registerReceiver(android.content.BroadcastReceiver receiver, android.content.IntentFilter filter, boolean isGlobal) {

if (isGlobal) {
this.webView.getContext().registerReceiver(receiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
this.webView.getContext().registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
} else {
this.webView.getContext().registerReceiver(receiver, filter);
}
return;
}
LocalBroadcastManager.getInstance(super.webView.getContext()).registerReceiver(receiver, filter);
Expand Down

0 comments on commit b3c8dd6

Please sign in to comment.