download file chat solved

This commit is contained in:
Eudes Inácio
2023-08-20 22:05:46 +01:00
parent cb0c4459a7
commit 2dea55c7f0
4 changed files with 28 additions and 25 deletions
+1
View File
@@ -13,4 +13,5 @@
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
@@ -1060,7 +1060,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
return blob;
}
openFile(pdfString, filename, type) {
async openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, 'application/pdf')
let pathFile = ''
const fileName = filename
@@ -1071,17 +1071,17 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
await Filesystem.writeFile({
path: fileName,
data: pdfString,
directory: Directory.Documents,
}).then((dir) => {
console.log('DIR ', dir)
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
.open(dir.uri, type)
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.error(e))
});
}
downloadFileMsg(msg: MessageService) {
+9 -7
View File
@@ -1001,7 +1001,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
return blob;
}
openFile(pdfString, filename, type) {
async openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, type)
console.log(blob)
let pathFile = ''
@@ -1015,15 +1015,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
console.log(pathFile)
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
await Filesystem.writeFile({
path: fileName,
data: pdfString,
directory: Directory.Documents,
}).then((dir) => {
console.log('DIR ', dir)
this.fileOpener
.open(pathFile + fileName, type)
.open(dir.uri, type)
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.error(e))
});
}
downloadFileFromBrowser(fileName: string, data: any): void {
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "1e4321d29",
"SHA": "1e4321d2946ee8ef98f0547f002ea74402b95c3a",
"shortSHA": "cb0c4459a",
"SHA": "cb0c4459a704510a0666480af4aaf9841079a29c",
"branch": "developer",
"lastCommitAuthor": "'Eudes Inácio'",
"lastCommitTime": "'Sat Aug 19 22:25:12 2023 +0100'",
"lastCommitMessage": "mock profile picture added",
"lastCommitNumber": "5175",
"lastCommitTime": "'Sun Aug 20 18:09:10 2023 +0100'",
"lastCommitMessage": "update badge das notificações",
"lastCommitNumber": "5178",
"change": "",
"changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 6 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/models/beast-orm.ts\n\tmodified: src/app/models/chatMethod.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.html\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.html\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/pipes/filter.pipe.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.scss\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.html\n\tmodified: src/app/store/publication-folder.service.ts\n\tmodified: src/theme/variables.scss",
"changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 9 and 5 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: android/app/src/main/AndroidManifest.xml\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts",
"changeAuthor": "eudes.inacio"
}