diff --git a/CHANGELOG.md b/CHANGELOG.md index 922369d3b..e1b3ef78b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 The changes documented here do not include those from the original repository. ## [Unreleased] + +## [4.2.0-OS41] + +### Features +- [Android] Ask for gallery permissions for RecordVideo (https://outsystemsrd.atlassian.net/browse/RMET-2472). - [Android] Update Error Codes and Error Messages (https://outsystemsrd.atlassian.net/browse/RMET-2400). - [Android] Add compression to big images (https://outsystemsrd.atlassian.net/browse/RMET-2409). - [iOS] Update Error Codes and Error Messages (https://outsystemsrd.atlassian.net/browse/RMET-2400). - [iOS] Add return of Metadata to `Choose from Gallery` and `Record Video` (https://outsystemsrd.atlassian.net/browse/RMET-2349). - [Bridge] Add `include Metadata` client action input parameter (https://outsystemsrd.atlassian.net/browse/RMET-2346). - -### Features - [iOS] Add `Play Video` client action (https://outsystemsrd.atlassian.net/browse/RMET-2360). - [Android] Play Video for Android (https://outsystemsrd.atlassian.net/browse/RMET-2359) - [Bridge] Add `Play Video` client action (https://outsystemsrd.atlassian.net/browse/RMET-2361). diff --git a/build/ci/azure-pipeline-test.yml b/build/ci/azure-pipeline-test.yml index 8d2104dd2..ab29c5a73 100644 --- a/build/ci/azure-pipeline-test.yml +++ b/build/ci/azure-pipeline-test.yml @@ -50,7 +50,7 @@ stages: - template: build/ci/refresh-sampleapp.yaml@MobilePluginsODCPipeline parameters: secretFileName: "eng-osrd-mobile-neo1-StampsInformation.json" - SAMPLEAPP_APP_KEY: "3c0451ef-0d99-4e09-adb5-718e009deb9d" + SAMPLEAPP_APP_KEY: "15d54f75-779d-4cae-948f-1bc119a7e813" workingDirectory: $(System.DefaultWorkingDirectory)/MobilePluginsODCPipeline - script: | echo "##vso[task.setvariable variable=apkPath]$(cat /tmp/3c0451ef-0d99-4e09-adb5-718e009deb9d.apk-path)" diff --git a/libs/android/build.gradle b/libs/android/build.gradle index eaac7a3c0..e6f35b7ab 100644 --- a/libs/android/build.gradle +++ b/libs/android/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'kotlin-kapt' dependencies { implementation("com.github.outsystems:oscore-android:1.1.0@aar") implementation("com.github.outsystems:oscordova-android:1.1.0@aar") - implementation("com.github.outsystems:oscamera-android:0.0.21@aar") + implementation("com.github.outsystems:oscamera-android:1.0.0@aar") } // Defer the definition of the dependencies to the end diff --git a/src/android/CameraLauncher.kt b/src/android/CameraLauncher.kt index 83c114f6d..b9f890240 100644 --- a/src/android/CameraLauncher.kt +++ b/src/android/CameraLauncher.kt @@ -119,6 +119,8 @@ class CameraLauncher : CordovaPlugin() { OSCAMRImageHelper() ) + camController?.deleteVideoFilesFromCache(cordova.activity) + } override fun onDestroy() { @@ -360,10 +362,49 @@ class CameraLauncher : CordovaPlugin() { fun callCaptureVideo(saveVideoToGallery: Boolean) { - if (!PermissionHelper.hasPermission(this, Manifest.permission.CAMERA)) { - PermissionHelper.requestPermission(this, CAPTURE_VIDEO_SEC, Manifest.permission.CAMERA) + val cameraPermissionNeeded = !PermissionHelper.hasPermission(this, Manifest.permission.CAMERA) + + val galleryPermissionNeeded = saveVideoToGallery && !((Build.VERSION.SDK_INT < 33 && + PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) && + PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) || + (Build.VERSION.SDK_INT >= 33 && + PermissionHelper.hasPermission(this, READ_MEDIA_VIDEO) && + PermissionHelper.hasPermission(this, READ_MEDIA_IMAGES))) + + if (cameraPermissionNeeded && galleryPermissionNeeded) { + PermissionHelper.requestPermissions(this, CAPTURE_VIDEO_SEC, permissions) return } + + else if (cameraPermissionNeeded) { + PermissionHelper.requestPermission( + this, + CAPTURE_VIDEO_SEC, + Manifest.permission.CAMERA + ) + return + } + else if (galleryPermissionNeeded) { + if (Build.VERSION.SDK_INT < 33) { + PermissionHelper.requestPermissions( + this, + CAPTURE_VIDEO_SEC, + arrayOf( + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE + ) + ) + } + else { + PermissionHelper.requestPermissions( + this, + CAPTURE_VIDEO_SEC, + arrayOf(READ_MEDIA_VIDEO, READ_MEDIA_IMAGES) + ) + } + return + } + cordova.setActivityResultCallback(this) camController?.captureVideo(cordova.activity, saveVideoToGallery) { sendError(it) diff --git a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/OSCameraLib b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/OSCameraLib index a4d227292..50d258b6a 100755 Binary files a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/OSCameraLib and b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/OSCameraLib differ diff --git a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/_CodeSignature/CodeResources b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/_CodeSignature/CodeResources index 926e3bf83..b3e795233 100644 --- a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/_CodeSignature/CodeResources +++ b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64/OSCameraLib.framework/_CodeSignature/CodeResources @@ -26,7 +26,7 @@ Modules/OSCameraLib.swiftmodule/arm64-apple-ios.swiftmodule - c3+Iy/Fbdb37R5rG4AksgsoDbTY= + pn+UN5evVesW+Pl93WwhFwevnD4= Modules/module.modulemap @@ -67,7 +67,7 @@ hash2 - CfDFxBOVjspmPiI3P/nCqOvLPJiDH3BT/3t4Gsf8tPU= + /x7zGKOvi/mrZQS8m+Y8Sp7uQxRafq2sgXgJ0UcUZ6Y= Modules/module.modulemap diff --git a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/OSCameraLib b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/OSCameraLib index 38ea8bf9b..6edeab102 100755 Binary files a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/OSCameraLib and b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/OSCameraLib differ diff --git a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/_CodeSignature/CodeResources b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/_CodeSignature/CodeResources index 47e820338..b85676468 100644 --- a/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/_CodeSignature/CodeResources +++ b/src/ios/frameworks/OSCameraLib.xcframework/ios-arm64_x86_64-simulator/OSCameraLib.framework/_CodeSignature/CodeResources @@ -26,7 +26,7 @@ Modules/OSCameraLib.swiftmodule/arm64-apple-ios-simulator.swiftmodule - otYLFh5+TbwzPqtakHdAGL5G9ks= + wiiPuVv+tcuYZvtsuedmoMBjnWE= Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc @@ -38,7 +38,7 @@ Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftmodule - BMLVbXAQGb+KGk7Czk7JpE//FdI= + WAby1/0p0H72/PtKAP+hKIB7ZSU= Modules/module.modulemap @@ -79,7 +79,7 @@ hash2 - 2QCPp7boRVM7FSNs/WLbstRuPPzvf0qN7hqXp4gbdK4= + DSYFCTaNfGWdpKBIxQaAaaCkoRpNmkdDqvjQSUZOY9A= Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc @@ -100,7 +100,7 @@ hash2 - sJ6JVd6DQ46oHmrRaOUvdY8Dp4fu8Sdmo+hKWGFHW3I= + 9iZDDd1++tlqjGWvirhI+IMZlYcDxTLk7R++gx0JodU= Modules/module.modulemap