capacitor

Hide Splash Screen in Ionic Capacitor React

我们两清 提交于 2020-06-26 07:22:25
问题 How can we disable the splash screen on an Ionic App? I am using Ionic 4, Capacitor and React. I have tried to add this on capacitor.config.json { "plugins": { "SplashScreen": { "launchShowDuration": 0 } } } The above code is not working at all. 回答1: You can hide the splash screen using the SplashScreen plugin : import { Plugins } from '@capacitor/core'; const { SplashScreen } = Plugins; function useSplashHide(){ useEffect(() => { SplashScreen.hide(); }, []); } Documentation is here 回答2: You

ionic capacitor qrscanner activity compat

浪尽此生 提交于 2020-05-27 12:37:30
问题 I'm creating an ionic capacitor application. In my app I have to use QR Scanner so I used https://ionicframework.com/docs/native/qr-scanner plugin to integrate qr scanner. Then I do ionic capacitor copy android and ionic capacitor open android . Then in android studio when I try to build it throws capacitor-cordova-android-plugins/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java -cannot find symbol class ActivityCompat -cannot find symbol variable ActivityCompat Ionic version is 6.4

Capacitor - Trying to catch the cancel on camera

↘锁芯ラ 提交于 2020-05-15 08:08:52
问题 I am using Capacitor with Ionic 4 and I would like to catch when the user taps on cancel when on the camera. public async takePicture(): Promise<string> { const image: CameraPhoto = await Camera.getPhoto({ quality: 90, allowEditing: true, correctOrientation: true, resultType: CameraResultType.Uri, source: CameraSource.Camera }).catch((e) => { throw new Error(e); }); return this._IMAGE = image.webPath; } I am simply try to catch and error but clicking on cancel does not throw an error anymore

Capacitor - Trying to catch the cancel on camera

人走茶凉 提交于 2020-05-15 08:08:51
问题 I am using Capacitor with Ionic 4 and I would like to catch when the user taps on cancel when on the camera. public async takePicture(): Promise<string> { const image: CameraPhoto = await Camera.getPhoto({ quality: 90, allowEditing: true, correctOrientation: true, resultType: CameraResultType.Uri, source: CameraSource.Camera }).catch((e) => { throw new Error(e); }); return this._IMAGE = image.webPath; } I am simply try to catch and error but clicking on cancel does not throw an error anymore

Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`

只谈情不闲聊 提交于 2020-04-30 08:44:37
问题 I'm building an app with capacitor for ios. When I launch the command 'npx cap sync ios' (which launch pod install ) and I get this error : ✖ Updating iOS native dependencies with "pod install" (may take several minutes): ✖ update ios: [error] Error running update: Analyzing dependencies Cloning spec repo `trunk` from `https://cdn.cocoapods.org/` [!] Unable to add a source with url `https://cdn.cocoapods.org/` named `trunk`. You can try adding it manually in `/Users/damien/.cocoapods/repos`

How to display base64 image on iPhone in Ionic 4

三世轮回 提交于 2020-04-18 06:12:15
问题 I am using Capacitor Plugins to get the image file (from camera or gallery). PC and Android are working fine, but the code crashes on iPhone. It opens the galery, I grab the image and it crashes when trying to display I checked the permissions and they are all set. Why would it crash only on ios? Is it a problem with the string? Security? HTML: < ion-img role="button" class="image" [src]="selectedImage" *ngIf="selectedImage" > TS CODE: Plugins.Camera.getPhoto({ quality: 100, source:

Capacitor on iOS: POST request fails

懵懂的女人 提交于 2020-04-18 03:48:32
问题 I'm using Ionic (v5) + React + Capacitor to create an app for iOS and I recently got stuck with a really strange error: fetch() and axios successfully perform GET requests to the backend while POST requests are always failing. fetch() returns "cancelled" which tells me nothing but a failure meanwhile axios generates a more descriptive error: { "message": "Network Error", "name": "Error", "stack": "capacitor://localhost/static/js/8.98344607.chunk.js:2:168604\ncapacitor://localhost/static/js/8

Keep app working even when phone is locked/sleep - Ionic4

假如想象 提交于 2020-03-04 05:06:33
问题 App is an ionic4 capacitor app which uses few cordova plugins as well. I have a timer feature associated with a bluetooth device that has to keep running even when the phone goes to sleep or in locked mode. Using the cordova-background-mode plugin the app works in the background, but as soon as phone is locked or in sleep the timer stops working. When the screen resumes, the timer continues from where it stopped. I cannot use the platform pause and resume events in my case as just taking the

Keep app working even when phone is locked/sleep - Ionic4

旧巷老猫 提交于 2020-03-04 05:06:12
问题 App is an ionic4 capacitor app which uses few cordova plugins as well. I have a timer feature associated with a bluetooth device that has to keep running even when the phone goes to sleep or in locked mode. Using the cordova-background-mode plugin the app works in the background, but as soon as phone is locked or in sleep the timer stops working. When the screen resumes, the timer continues from where it stopped. I cannot use the platform pause and resume events in my case as just taking the

Ionic4 capacitor android livereload?

三世轮回 提交于 2020-02-02 11:01:58
问题 Is there posibility to run ionic4 app with capacitor on android device with livereload? I was looking for answear for a few hours now without a luck. Please help. 回答1: You can do it by adding the server object to the capacitor.config.json file, just use the url of your live reload server "server": { "url": "http://192.168.1.33:8100" } 回答2: You can use the ionic cli for this: ionic capacitor run android --livereload For example. Source: https://ionicframework.com/docs/cli/commands/capacitor