@droponio/capacitor-intent-fragment 1.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/android/build.gradle +3 -3
- package/android/src/main/java/io/dropon/capacitor/intent/CapacitorIntentPlugin.java +26 -3
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +1 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -25,12 +25,12 @@ npx cap sync
|
|
|
25
25
|
### registerBroadcastReceiver(...)
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
registerBroadcastReceiver(options: { filters: string[]; }, callback: (data: { [key: string]: any; }) => void) => Promise<string>
|
|
28
|
+
registerBroadcastReceiver(options: { filters: string[]; exported?: boolean; }, callback: (data: { [key: string]: any; }) => void) => Promise<string>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
| Param | Type |
|
|
32
32
|
| -------------- | ------------------------------------------------------- |
|
|
33
|
-
| **`options`** | <code>{ filters: string[]; }</code>
|
|
33
|
+
| **`options`** | <code>{ filters: string[]; exported?: boolean; }</code> |
|
|
34
34
|
| **`callback`** | <code>(data: { [key: string]: any; }) => void</code> |
|
|
35
35
|
|
|
36
36
|
**Returns:** <code>Promise<string></code>
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace "io.dropon.capacitor.intent"
|
|
22
|
-
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
23
23
|
defaultConfig {
|
|
24
24
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -89,15 +89,38 @@ public class CapacitorIntentPlugin extends Plugin {
|
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
93
|
+
int flag = Boolean.TRUE.equals(call.getBoolean("exported", false))
|
|
94
|
+
? Context.RECEIVER_EXPORTED
|
|
95
|
+
: Context.RECEIVER_NOT_EXPORTED;
|
|
96
|
+
this.getContext().registerReceiver(receiverMap.get(callBackID), ifilt, flag);
|
|
97
|
+
} else {
|
|
98
|
+
this.getContext().registerReceiver(receiverMap.get(callBackID), ifilt);
|
|
99
|
+
}
|
|
93
100
|
} else {
|
|
94
101
|
call.reject("Filters are required: at least 1 entry");
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
private void removeReceiver(String callBackID) {
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
BroadcastReceiver receiver = receiverMap.remove(callBackID);
|
|
107
|
+
if (receiver == null) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
this.getContext().unregisterReceiver(receiver);
|
|
112
|
+
} catch (IllegalArgumentException e) {
|
|
113
|
+
Log.d(LOG_TAG, "Receiver already unregistered: " + callBackID);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@Override
|
|
118
|
+
protected void handleOnDestroy() {
|
|
119
|
+
for (String callBackID : new ArrayList<>(receiverMap.keySet())) {
|
|
120
|
+
removeReceiver(callBackID);
|
|
121
|
+
}
|
|
122
|
+
watchingCalls.clear();
|
|
123
|
+
super.handleOnDestroy();
|
|
101
124
|
}
|
|
102
125
|
|
|
103
126
|
private static Object toJsonValue(final Object value) throws JSONException {
|
package/dist/docs.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "registerBroadcastReceiver",
|
|
10
|
-
"signature": "(options: { filters: string[]; }, callback: (data: { [key: string]: any; }) => void) => Promise<string>",
|
|
10
|
+
"signature": "(options: { filters: string[]; exported?: boolean; }, callback: (data: { [key: string]: any; }) => void) => Promise<string>",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "options",
|
|
14
14
|
"docs": "",
|
|
15
|
-
"type": "{ filters: string[]; }"
|
|
15
|
+
"type": "{ filters: string[]; exported?: boolean | undefined; }"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "callback",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorIntentPlugin {\n registerBroadcastReceiver(\n options: { filters: string[] },\n callback: (data: { [key: string]: any }) => void\n ): Promise<string>;\n\n unregisterBroadcastReceiver(options: { id: string }): Promise<void>;\n\n sendBroadcastIntent(options: { action: string; value: { [key: string]: any } }): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorIntentPlugin {\n registerBroadcastReceiver(\n options: { filters: string[]; exported?: boolean },\n callback: (data: { [key: string]: any }) => void\n ): Promise<string>;\n\n unregisterBroadcastReceiver(options: { id: string }): Promise<void>;\n\n sendBroadcastIntent(options: { action: string; value: { [key: string]: any } }): Promise<void>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { CapacitorIntentPlugin } from './definitions';
|
|
|
3
3
|
export declare class CapacitorIntentWeb extends WebPlugin implements CapacitorIntentPlugin {
|
|
4
4
|
registerBroadcastReceiver(_options: {
|
|
5
5
|
filters: string[];
|
|
6
|
+
exported?: boolean;
|
|
6
7
|
}, _callback: (data: {
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
}) => void): Promise<string>;
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,yBAAyB,CAC7B,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,yBAAyB,CAC7B,QAAmD,EACnD,SAAiD;QAEjD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,QAAwB;QACxD,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,QAGzB;QACC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorIntentPlugin } from './definitions';\n\nexport class CapacitorIntentWeb\n extends WebPlugin\n implements CapacitorIntentPlugin\n{\n async registerBroadcastReceiver(\n _options: { filters: string[]; exported?: boolean },\n _callback: (data: { [key: string]: any }) => void,\n ): Promise<string> {\n throw new Error('Feature not implemented in web.');\n }\n\n async unregisterBroadcastReceiver(_options: { id: string }) {\n throw new Error('Feature not implemented in web.');\n }\n\n async sendBroadcastIntent(_options: {\n action: string;\n value: { [key: string]: any };\n }): Promise<void> {\n throw new Error('Feature not implemented in web.');\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droponio/capacitor-intent-fragment",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Capacitor Js plugin for receveing and sending intents",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@capacitor/android": "^
|
|
49
|
-
"@capacitor/core": "^
|
|
48
|
+
"@capacitor/android": "^6.0.0",
|
|
49
|
+
"@capacitor/core": "^6.0.0",
|
|
50
50
|
"@capacitor/docgen": "^0.0.18",
|
|
51
|
-
"@capacitor/ios": "^
|
|
52
|
-
"@ionic/eslint-config": "^0.
|
|
51
|
+
"@capacitor/ios": "^6.0.0",
|
|
52
|
+
"@ionic/eslint-config": "^0.4.0",
|
|
53
53
|
"@ionic/prettier-config": "^1.0.1",
|
|
54
54
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
55
|
-
"eslint": "^
|
|
55
|
+
"eslint": "^8.57.0",
|
|
56
56
|
"prettier": "~2.3.0",
|
|
57
57
|
"prettier-plugin-java": "~1.0.2",
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "~4.1.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@capacitor/core": "^
|
|
64
|
+
"@capacitor/core": "^6.0.0"
|
|
65
65
|
},
|
|
66
66
|
"prettier": "@ionic/prettier-config",
|
|
67
67
|
"swiftlint": "@ionic/swiftlint-config",
|