CameraSource.Photos is opening pwa camera instead of gallery - ionic-framework

Camera.getPhoto() with source Photos is opening pwa camera instead of showing gallery in my android phone. I also tried using Prompt as a source but the result was same.
accessGallery() {
return Camera.getPhoto({
resultType: CameraResultType.Base64,
source: CameraSource.Photos,
quality: 100,
});
}
Versions:
ionic --version is 6.10.1
#capacitor/android: ^1.5.2
#capacitor/core: ^1.5.2

Related

url_strategy does not work in flutter web

I used url_strategy in flutter web channel stable and beta.
I run flutter web in Landscape its work (image 1)
but when I changed Dimensions to Samsung or motog4 or iphone 5s does not work.(image 2),
this is my code:
import 'package:url_strategy/url_strategy.dart';
void main() {
// Here we set the URL strategy for our web app.
setPathUrlStrategy();
runApp(MyApp());
}
Image 1
Image 2
This error occurred because of index.html was old.
I just delete old web folder and create new web folder .
run below code in terminal and create new web folder with new index.html
flutter create .

Flutter issue - iOS platform not able to load the video from S3 (PlatformException(VideoError, Failed to load video: Cannot Open, null, null))

I am trying to play a video from S3 storage on Iphone X (14.71 iOS version) but I receive the following error:
2021-10-10 00:43:02.134221+0200 Runner[2045:114048] [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: PlatformException(VideoError, Failed to load video: Cannot Open, null, null)
The video is successfully uploaded on S3 but I have no luck running it based on the URL.
URL seems to be correct as the issue is not seen on Android devices.
I've also tried the https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4 video which seems to be working on iOS.
For some reason only the S3 uploaded videos captured by my phone cannot be played.
Below is the video_player version in pubspec.yaml:
video_player: 0.2.5
Flutter version: 2.6.0-11.0.pre
Flutter channel: dev channel

Media plugin not installed? Ionic 3

I have an Ionic 3 app that requires to use Media Plugin.
When I press the "record" button on my app, this code block is executed:
this.platform.ready().then(() => {
this.fileName = this.commentsProvider.getFileName(this.platform);
this.filePath = this.commentsProvider.getFilePath(this.platform, this.fileName);
this.audio = this.media.create(this.filePath);
this.audio.startRecord();
this.recording = true;
});
And it doesn't works. The console throws:
console.warn: Native: tried accessing the Media plugin but it's not installed.
NOTE: I'm runing the app in a connected Android device, via USB.
You can see I'm using platform.ready() and anyway I still have this problem.
Any idea?
Thank's in advance!
EDIT: I've already deleted node_modules and plugins folders, and ran npm install, and the problem persists.

How I can check android version of device? (ionic 2,3)

for android 4.2.2, ionic app shows white screen.
I want to know if the device had this version of android, app would show a message and would notify that this version of android is not supported.
is it possible?
I founded this solution:
let platformVersion = platform.versions();
if (platformVersion.android) {
let androidV = platformVersion.android.num;
console.log(androidV);
if (androidV < 4.4) {
let alert = this.alertCtrl.create({
message: 'Please update android ...'
});
alert.present();
// or push a single page for this error:
//this.nav.setRoot(ErrorPage);
}
}
for show this message in android device with version older than 4.4 we must be install this:
cordova plugin add cordova-plugin-crosswalk-webview
for more information visit this link:
https://crosswalk-project.org/documentation/cordova.html

cordova 3.4 file 1.0.1 resolveLocalFileSystemURI android issue

I am trying to get a full path to an image retrieved from Android image library. via the camera plugin.
window.resolveLocalFileSystemURI("content://media/external/images/media/83", function(fileEntry) {
or
window.resolveLocalFileSystemURL(imageURI, function(fileEntry) {
fileEntry.file(function(fileObj) {
newimageURI = fileObj.fullPath;
alert(newimageURI);
});
});
returns undefined.
There was updates the other day and it is no longer working. I have tried toURL() as well with no success.
Try removing the file plugin and adding it again. Works for me. I think it's related to this bug: Cordova iOS Plugins fail after building, unless I remove platform and plugin JSON first