File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,20 @@ import {URL as whatwgUrl} from 'whatwg-url-without-unicode';
33
44let BLOB_URL_PREFIX = null ;
55
6- const { BlobModule } = NativeModules ;
6+ const NativeBlobModule = NativeModules . BlobModule ;
77
8- if ( BlobModule && typeof BlobModule . BLOB_URI_SCHEME === 'string' ) {
9- BLOB_URL_PREFIX = BlobModule . BLOB_URI_SCHEME + ':' ;
10- if ( typeof BlobModule . BLOB_URI_HOST === 'string' ) {
11- BLOB_URL_PREFIX += `//${ BlobModule . BLOB_URI_HOST } /` ;
8+ if (
9+ NativeBlobModule &&
10+ typeof NativeBlobModule . getConstants ( ) . BLOB_URI_SCHEME === 'string'
11+ ) {
12+ const constants = NativeBlobModule . getConstants ( ) ;
13+ BLOB_URL_PREFIX = constants . BLOB_URI_SCHEME + ':' ;
14+ if ( typeof constants . BLOB_URI_HOST === 'string' ) {
15+ BLOB_URL_PREFIX += `//${ constants . BLOB_URI_HOST } /` ;
1216 }
1317}
1418
15- /**
19+ /*
1620 * To allow Blobs be accessed via `content://` URIs,
1721 * you need to register `BlobProvider` as a ContentProvider in your app's `AndroidManifest.xml`:
1822 *
You can’t perform that action at this time.
0 commit comments