Skip to content

Android - Exposed beyond app through ClipData.Item.getUri() #299

Closed
@gbferreira

Description

@gbferreira

I'm trying to share some picture with react-native-share lib.

RNFetchBlob.config({
          fileCache: true,
          appendExt: 'jpeg'
        })
          .fetch('GET', url)
          .then((res) => {
            const shareOptions = {
              url: `data:image/jpeg;base64,${res.base64()}`,
              type: 'image/jpeg',
            };

            try {
              Share.open(shareOptions).then(() => {
                // OK
              });
            } catch (error) {
             // ERROR
            }
          });

When i test in IOS i can share normally, but in android i receive this error.
Image of Error

I recently discover this issue is referenced in wkh237#358 and maybe occurs because i upgrade my 'targetSdkVersion' to >= 24 (https://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed) or is my 'react-native' version. ;
I'm using:

  • react-native: 0.57.8;
  • rn-fetch-blob: 0.10.15;
  • react-native-share: 1.0.21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions