Android email share name has extension .null

This works with IOS but with Android 7 ( Huawei ) the file attached is like 1501167383416.null.


share = (uri) => {
RNFetchBlob.fs.readFile(uri, ‘base64’)
.then((data) => {
let shareOptions = {
title: “React Native Share Example”,
message: “Check out this photo!”,
type: “image/jpg”,
url: data:image/jpg;base64,${data},
subject: “Check out this photo!”
}

    Share.open(shareOptions)
      .catch(err => console.log('err', err))
  })

}

Any idea?

best regards,
Lorenzo

4 thoughts on “Android email share name has extension .null

  1. I also got the same issue and just for the sake of experiment I did url: data:image/png;base64,${data} for jpg image and it worked unexpectedly. Hope it helps somebody.

  2. If you want to send a jpg you should use image/jpeg rather than image/jpg

    data:image/jpeg;base64,${data}

Comments are closed.

Android email share name has extension .null

This works with IOS but with Android 7 ( Huawei ) the file attached is like 1501167383416.null.


share = (uri) => {
RNFetchBlob.fs.readFile(uri, ‘base64’)
.then((data) => {
let shareOptions = {
title: “React Native Share Example”,
message: “Check out this photo!”,
type: “image/jpg”,
url: data:image/jpg;base64,${data},
subject: “Check out this photo!”
}

    Share.open(shareOptions)
      .catch(err => console.log('err', err))
  })

}

Any idea?

best regards,
Lorenzo

3 thoughts on “Android email share name has extension .null

  1. I also got the same issue and just for the sake of experiment I did url: data:image/png;base64,${data} for jpg image and it worked unexpectedly. Hope it helps somebody.

  2. If you want to send a jpg you should use image/jpeg rather than image/jpg

    data:image/jpeg;base64,${data}

Comments are closed.