Issue
This is my code
let f: any = XLSX.writeFile(wb, this.generarNombre(pedido.folio), {
bookType: 'xlsx',
type: 'array'
})
let data: Blob = new Blob([f], { type: EXCEL_TYPE })
let file = new File([data], this.generarNombre(pedido.folio), {
type: EXCEL_TYPE
})
let navigator = window.navigator as any
return new Promise((resolve, reject) => {
let data = {
files: [file],
title: this.generarNombre(pedido.folio),
text: pedido.folio
}
if (navigator.canShare(data))
navigator.share(data).then(result => resolve(result))
else reject('No soportado por el dispositivo')
})
}
My application is a PWA and it is installed successfully in android, the problem is that instead of sharing with the native option of android it only downloads the file. How can i solve this?
Solution
You can implement directly and check this out as in web.dev here
Or better use this pwa library, pwafire;
pwa.Share({ // Title of what to share title: "Some title..", // Text to share text: "Some text...", // List of files to share... files: file_list
};)
Answered By - Maye Edwin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.