diff --git a/build_config b/build_config index f71b254cd6..40340a941f 100644 --- a/build_config +++ b/build_config @@ -25,7 +25,7 @@ cordova-plugin=cordova-plugin-appavailability cordova-plugin=cordova-plugin-filepicker cordova-plugin=cordova-plugin-document-viewer cordova-plugin=com-sarriaroman-photoviewer -cordova-plugin=cordova-plugin-filepath +cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-filepath.git cordova-plugin=https://github.com/greybax/cordova-plugin-proguard.git cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-utility.git#release-4.1.0 cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-downloadmanager.git @@ -33,7 +33,7 @@ cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-db.git#release-4. cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-customtabs.git#release-5.0.2 --variable URL_SCHEME=@string/custom_scheme_url --variable URL_HOST=mobile cordova-plugin=cordova-sqlite-storage cordova plugin=cordova-plugin-googleplus -cordova-pligin=cordova-plugin-camera +cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-camera.git cordova-plugin=cordova-plugin-telerik-imagepicker@2.3.3 cordova-plugin=cordova-plugin-filechooser cordova-plugin=cordova-plugin-media diff --git a/src/app/manage-learn/core/services/attachment/attachment.service.ts b/src/app/manage-learn/core/services/attachment/attachment.service.ts index 38a6060ac7..1d4f25c705 100644 --- a/src/app/manage-learn/core/services/attachment/attachment.service.ts +++ b/src/app/manage-learn/core/services/attachment/attachment.service.ts @@ -79,7 +79,6 @@ export class AttachmentService { { text: this.texts["FRMELEMNTS_MSG_USE_FILE"], handler: () => { - console.log(path,"oath"); path ? this.openLocalLibrary() : this.openFile(); return false; }, @@ -115,7 +114,7 @@ export class AttachmentService { text: this.texts["FRMELEMENTS_LBL_UPLOAD_IMAGE"], icon: "cloud-upload", handler: () => { - this.openLocalLibrary() + this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY, this.camera.MediaType.PICTURE); return false; }, }, @@ -160,7 +159,7 @@ export class AttachmentService { .then((imagePath) => { if (this.platform.is("android") && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY) { let newFilePath = imagePath; - if (!newFilePath.includes("file://")) { + if (!newFilePath.includes("content://") && !newFilePath.includes("file://")) { newFilePath = "file://" + imagePath } this.checkForFileSizeRestriction(newFilePath).then(isValidFile => { @@ -221,7 +220,8 @@ export class AttachmentService { checkForFileSizeRestriction(filePath): Promise { return new Promise((resolve, reject) => { - this.file.resolveLocalFilesystemUrl(filePath).then(success => { + this.filePath.resolveNativePath(filePath).then(fileData =>{ + this.file.resolveLocalFilesystemUrl(fileData).then(success => { success.getMetadata((metadata) => { if (metadata.size > localStorageConstants.FILE_LIMIT) { this.presentToast(this.texts["FRMELEMNTS_LBL_FILE_SIZE_EXCEEDED"],'danger', 5000); @@ -233,6 +233,9 @@ export class AttachmentService { }).catch(error => { reject(false) }) + }).catch(error => { + reject(false) + }) }) }