Skip to content

Commit 1dfe0f8

Browse files
committed
fix: not working on Android 11
- update dependencies - Closes #4
1 parent 961295f commit 1dfe0f8

File tree

32 files changed

+6716
-1685
lines changed

32 files changed

+6716
-1685
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Install the plugin in your app.
2828
npm install @finanzritter/nativescript-share-file
2929
~~~
3030

31+
### Android FileProvider Setup
32+
33+
On Android, you must add a FileProvider definition and specify available files, which is documented [here](https://developer.android.com/reference/androidx/core/content/FileProvider#ProviderDefinition) or have a look at the demo app (AndroidManifest.xml and file_paths.xml).
34+
3135
## Usage
3236

3337
Info: Shared files should be in the `documents` path.

demo/app/App_Resources/Android/AndroidManifest.xml renamed to demo/app/App_Resources/Android/src/main/AndroidManifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
android:label="@string/app_name"
2626
android:theme="@style/AppTheme">
2727

28+
<provider
29+
android:name="androidx.core.content.FileProvider"
30+
android:authorities="${applicationId}.fileprovider"
31+
android:exported="false"
32+
android:grantUriPermissions="true">
33+
<meta-data
34+
android:name="android.support.FILE_PROVIDER_PATHS"
35+
android:resource="@xml/file_paths" />
36+
</provider>
37+
2838
<activity
2939
android:name="com.tns.NativeScriptActivity"
3040
android:label="@string/title_activity_kimera"

0 commit comments

Comments
 (0)