Hi, I’m trying to use IntentLauncher to send a file (image, pdf, etc) to another APP.
I already send a text using
const result = await IntentLauncher.startActivityAsync('android.intent.action.SEND', {
type: "text/plain",
extra: {
'android.intent.extra.TEXT': 'text to share',
},
});
But when I do something using STREAM, this doen’t work.
// this gives me resultCode: -1, but doesnt send the file
const result = await IntentLauncher.startActivityAsync('android.intent.action.SEND', {
type: 'image/jpeg',
data: encodedURI
});
// none of those work
const result = await IntentLauncher.startActivityAsync('android.intent.action.SEND', {
type: "image/jpeg",
extra: {
'android.intent.extra.STREAM': encodedURI,
// or
// 'android.intent.extra.STREAM': uri,
}
});
// or
const data = await FileSystem.readAsStringAsync(encodedURI, {
encoding: FileSystem.EncodingType.Base64,
});
const result = await IntentLauncher.startActivityAsync('android.intent.action.SEND', {
type: "image/jpeg",
extra: {
'android.intent.extra.STREAM': ['data:image/jpeg;base64,', data].join(''),
}
});
const result = await IntentLauncher.startActivityAsync('android.intent.action.SEND', {
type: "image/jpeg",
data: uri,
// or
//data: ['data:image/jpeg;base64,', data].join(''),
});
There is some way to SEND a file to another APP, and not just a text?