com-easystep2-datawedge-plugin-intent-cordova 4.4.2 → 5.1.1
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/package.json +1 -1
- package/plugin.xml +1 -54
- package/src/android/IntentShim.java +14 -14
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="com-easystep2-datawedge-plugin-intent-cordova" version="4.4.
|
|
2
|
+
<plugin id="com-easystep2-datawedge-plugin-intent-cordova" version="4.4.3" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
3
|
<name>Intent Shim</name>
|
|
4
4
|
<js-module name="IntentShim" src="www/IntentShim.js">
|
|
5
5
|
<clobbers target="intentShim" />
|
|
@@ -21,60 +21,7 @@
|
|
|
21
21
|
<category android:name="android.intent.category.DEFAULT" />
|
|
22
22
|
</intent-filter>
|
|
23
23
|
</config-file>
|
|
24
|
-
<config-file target="AndroidManifest.xml" platform="android" parent="/manifest" mode="merge">
|
|
25
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
|
26
|
-
</config-file>
|
|
27
|
-
<config-file target="AndroidManifest.xml" platform="android" parent="/manifest/application" mode="merge">
|
|
28
|
-
<provider
|
|
29
|
-
android:name="com.easystep2.datawedge.plugin.intent.CordovaPluginIntentFileProvider"
|
|
30
|
-
android:authorities="${applicationId}.easystep2.datawedge.plugin.intent.fileprovider"
|
|
31
|
-
android:exported="false"
|
|
32
|
-
android:grantUriPermissions="true">
|
|
33
|
-
<meta-data
|
|
34
|
-
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
35
|
-
android:resource="@xml/provider_paths"/>
|
|
36
|
-
</provider>
|
|
37
|
-
</config-file>
|
|
38
|
-
|
|
39
|
-
<!-- Add explicit FileProvider configuration for Android 7+ (API 24+) -->
|
|
40
|
-
<config-file target="AndroidManifest.xml" parent="application">
|
|
41
|
-
<provider
|
|
42
|
-
android:name="androidx.core.content.FileProvider"
|
|
43
|
-
android:authorities="${applicationId}.easystep2.datawedge.plugin.intent.fileprovider"
|
|
44
|
-
android:exported="false"
|
|
45
|
-
android:grantUriPermissions="true">
|
|
46
|
-
<meta-data
|
|
47
|
-
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
48
|
-
android:resource="@xml/provider_paths" />
|
|
49
|
-
</provider>
|
|
50
|
-
</config-file>
|
|
51
|
-
|
|
52
|
-
<!-- Ensure FileProvider is properly configured -->
|
|
53
|
-
<config-file target="AndroidManifest.xml" parent="application">
|
|
54
|
-
<!-- FileProvider might already be defined, just ensure it has these attributes -->
|
|
55
|
-
<provider
|
|
56
|
-
android:name="androidx.core.content.FileProvider"
|
|
57
|
-
android:authorities="${applicationId}.easystep2.datawedge.plugin.intent.fileprovider"
|
|
58
|
-
android:exported="false"
|
|
59
|
-
android:grantUriPermissions="true">
|
|
60
|
-
<meta-data
|
|
61
|
-
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
62
|
-
android:resource="@xml/provider_paths" />
|
|
63
|
-
</provider>
|
|
64
|
-
</config-file>
|
|
65
|
-
|
|
66
|
-
<!-- Add necessary permissions with maxSdkVersion where appropriate -->
|
|
67
|
-
<config-file target="AndroidManifest.xml" parent="/*">
|
|
68
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
|
69
|
-
<!-- For Android 13+ (API 33+), add more specific media permissions -->
|
|
70
|
-
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
|
71
|
-
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
|
72
|
-
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
|
73
|
-
</config-file>
|
|
74
|
-
|
|
75
24
|
<source-file src="src/android/IntentShim.java" target-dir="src/com/easystep2/plugin/intent" />
|
|
76
|
-
<source-file src="src/android/CordovaPluginIntentFileProvider.java" target-dir="src/com/easystep2/plugin/intent" />
|
|
77
|
-
<resource-file src="src/android/res/xml/provider_paths.xml" target="res/xml/provider_paths.xml"/>
|
|
78
25
|
<framework src="androidx.core:core:1.1.0" />
|
|
79
26
|
</platform>
|
|
80
27
|
|
|
@@ -657,20 +657,20 @@ public class IntentShim extends CordovaPlugin {
|
|
|
657
657
|
//noinspection deprecation
|
|
658
658
|
i.putExtra(key, Html.fromHtml(valueStr));
|
|
659
659
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
660
|
+
} else if (key.equals(Intent.EXTRA_STREAM)) {
|
|
661
|
+
// allows sharing of images as attachments.
|
|
662
|
+
// value in this case should be a URI of a file
|
|
663
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && valueStr.startsWith("file://"))
|
|
664
|
+
{
|
|
665
|
+
Uri uriOfStream = remapUriWithFileProvider(valueStr, callbackContext);
|
|
666
|
+
if (uriOfStream != null)
|
|
667
|
+
i.putExtra(key, uriOfStream);
|
|
668
|
+
}
|
|
669
|
+
else
|
|
670
|
+
{
|
|
671
|
+
//final CordovaResourceApi resourceApi = webView.getResourceApi();
|
|
672
|
+
i.putExtra(key, resourceApi.remapUri(Uri.parse(valueStr)));
|
|
673
|
+
}
|
|
674
674
|
}
|
|
675
675
|
else if (key.equals(Intent.EXTRA_EMAIL)) {
|
|
676
676
|
// allows to add the email address of the receiver
|