Closed dagonco closed 4 months ago
I would improve the example:
- Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName?: "pdfname" } }
+ Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName: "pdfname.pdf" } }
Response → { type: "SHARE_BASE64", id: string }
I guess the extension will come in the fileName
right?
In addition, can fileName
be null
? I would force it as mandatory, wdyt?
I left it optional because for the SHARE method this filename field does not exist, and we are the ones who put "Document" as the file prefix, same with the extension.
But I dont have a strong opinion to let it mandatory and let web to put the extension, I just wanted to reuse all SHARE logic possible.
I would improve the example:
- Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName?: "pdfname" } } + Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName: "pdfname.pdf" } } Response → { type: "SHARE_BASE64", id: string }
I guess the extension will come in the
fileName
right? In addition, canfileName
benull
? I would force it as mandatory, wdyt?I left it optional because for the SHARE method this filename field does not exist, and we are the ones who put "Document" as the file prefix, same with the extension.
But I dont have a strong opinion to let it mandatory and let web to put the extension, I just wanted to reuse all SHARE logic possible.
I don't see the point in making this parameter optional. It implies that at the time of showing the modal Share if the filename is null we have to define a name for the file that we are going to share. I believe that this responsibility should come to us made from webapp and always receive a name with which we want to share the file.
I would improve the example:
- Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName?: "pdfname" } } + Request → { type: "SHARE_BASE64", id: string, payload: { content: "base64 string", fileName: "pdfname.pdf" } } Response → { type: "SHARE_BASE64", id: string }
I guess the extension will come in the
fileName
right? In addition, canfileName
benull
? I would force it as mandatory, wdyt?I left it optional because for the SHARE method this filename field does not exist, and we are the ones who put "Document" as the file prefix, same with the extension. But I dont have a strong opinion to let it mandatory and let web to put the extension, I just wanted to reuse all SHARE logic possible.
I don't see the point in making this parameter optional. It implies that at the time of showing the modal Share if the filename is null we have to define a name for the file that we are going to share. I believe that this responsibility should come to us made from webapp and always receive a name with which we want to share the file.
We agreed on making filename mandatory, modifying spec.
what is left to proceed with this?
Has this been considered? https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API
Web Share API is not supported in android webviews. So this proposal LGTM
Due to the new requirement to be able to generate invoices and that they can be shared or downloaded by the user. It is necessary to create a new bridge method since these invoices cannot be hosted anywhere. These files could be of any type (pdfs or zips).
Documentation:
ShareBase64
Success response
Empty response.
Error response codes
400 → Bad request: If payload is null or there's any missing mandatory parameter. 500 → Internal Error: If an error occurred while processing the file
Discarded ideas
http
/https
. A dataUrl wouldn't work. And this mechanism doesn't provide an option to specify the filename