diff --git a/.changeset/honest-flowers-repeat.md b/.changeset/honest-flowers-repeat.md new file mode 100644 index 00000000..38d44906 --- /dev/null +++ b/.changeset/honest-flowers-repeat.md @@ -0,0 +1,5 @@ +--- +"@react-native-documents/viewer": patch +--- + +fix authority string for FileProvider diff --git a/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt b/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt index e486a221..b757fdc2 100644 --- a/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt +++ b/packages/document-viewer/android/src/main/java/com/reactnativedocumentviewer/RNDocumentViewerModule.kt @@ -63,7 +63,7 @@ class RNDocumentViewerModule(reactContext: ReactApplicationContext) : NativeDocu } else if (bookmarkOrUri.startsWith("file://")) { val uri = Uri.parse(bookmarkOrUri) // TODO package name may not be the same as applicationId. Also see document-viewer/android/src/main/AndroidManifest.xml - val authority = reactApplicationContext.packageName + ".reactnativedocumentviewer.provider" + val authority = reactApplicationContext.packageName + ".reactnativedocumentviewer.fileprovider" val uriPath = uri.path ?: throw IllegalArgumentException("file:// uri must have a path") val fileUri = FileProvider.getUriForFile( reactApplicationContext,