Merge branch 'feature/viewer-attachment' of bitbucket.org:equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Peter Maquiran
2024-03-04 09:11:41 +01:00
6 changed files with 131 additions and 21 deletions
+90
View File
@@ -1,6 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Gabinete Digital</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.gpr.gabinetedigital.teste</string>
<key>CFBundleURLSchemes</key>
<array>
<string>gabinetedigital</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app does not require access to the microphone.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<!-- Firebase Push Notification Configurations -->
<key>FirebaseAppDelegateProxyEnabled</key>
<true/>
<key>UNUserNotificationCenterDelegate</key>
<string>YourApp.NotificationDelegate</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
</dict>
</plist>
<!-- <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
@@ -75,3 +164,4 @@
</dict>
</dict>
</plist>
-->
+9 -3
View File
@@ -65,6 +65,7 @@ export class NotificationsService {
}
requestPermissions() {
console.log('init notificaton permission')
if (this.platform.is('mobile')) {
if (!this.isPushNotificationsAvailable) {
@@ -72,17 +73,22 @@ export class NotificationsService {
}
PushNotifications.requestPermissions().then(async (result) => {
if (result.receive === 'granted') {
console.log('permission granted')
// Register with Apple / Google to receive push via APNS/FCM
try {
PushNotifications.register().catch((error) => {
console.log("Register device", error)
})
PushNotifications.register().then((value) => {
console.log("Register device", value)
this.getAndpostToken("")
}) .catch((error) => {
console.log("Register device error", error)
})
} catch (error) {
console.log("Granted permission error", error)
}
} else {
// Show some error
console.log('permission notification erro')
}
});
} else {
@@ -60,5 +60,5 @@
.desk{
text-align: left;
background-color: white;
background-color: transparent;
}
@@ -59,5 +59,5 @@
.desk{
text-align: left;
background-color: white;
background-color: transparent;
}
@@ -293,12 +293,13 @@ export class NewPublicationPage implements OnInit {
console.log('load video tablet base64', content)
this.filecontent = true;
let fileObject = new PublicationAttachmentEntity({
base64: content.data,
base64: 'data:video/mp4;base64,'+content.data,
extension: this.removeTextBeforeSlash(element.mimeType, '/'),
OriginalFileName: 'video',
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
})
/* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -731,11 +732,12 @@ export class NewPublicationPage implements OnInit {
data.forEach(async element => {
this.filesSizeSum = this.filesSizeSum + element.size
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
if(this.platform.is('ios'))
if(this.platform.is('ios')) {
this.recordevideoIos(element.fullPath)
} else {
this.recordVideoPc(element.fullPath)
}
} else {
if (this.publicationFormMV.form.Files.length === 0)
this.filesSizeSum = 0
@@ -776,14 +778,14 @@ console.log(stringGerada);
this.filecontent = true;
console.log('', content)
let fileObject = new PublicationAttachmentEntity({
base64: content.data,
base64: 'data:video/mp4;base64,'+content.data,
extension: 'mp4',
OriginalFileName: 'record',
FileType: 'video'
}
)
// fileObject.needUpload()
/* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((erro) => console.error('read converted video erro ', erro));
@@ -805,15 +807,27 @@ console.log(stringGerada);
.then(async (content) => {
this.filecontent = true;
console.log('', content)
let fileObject = new PublicationAttachmentEntity({
let fileObject;
if(this.platform.is('desktop')) {
fileObject = new PublicationAttachmentEntity({
base64: content.data,
extension: 'mp4',
OriginalFileName: 'record',
FileType: 'video'
})
} else {
fileObject = new PublicationAttachmentEntity({
base64: 'data:video/mp4;base64,'+content.data,
extension: 'mp4',
OriginalFileName: 'record',
FileType: 'video'
})
}
)
// fileObject.needUpload()
/* fileObject.needUpload() */
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -1,7 +1,7 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { Publication } from 'src/app/models/publication';
import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';
import { NewPublicationPage } from 'src/app/shared/publication/new-publication/new-publication.page';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'