Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

I can't copy files using Filesystem on android 11

$
0
0

Hi, I’m having a big problem now, I can’t copy files to Memory (specifically default documents folder on android), when I do copy I get the following error:

This is my code:

return Filesystem.copy({
          from: `${this.fileSource.path}${this.fileSource.name}`, // This is directory of file from User when imported
          to: `/.QHDDAIT/${this.fileName}`, // This is Folder that I want to copy file
          toDirectory: FilesystemDirectory.Documents,
        })
          .then((_res) => {
            console.log("---> Copy file to Device is successful: ", _res);
            this.setMyFile(this.fileName);
          })
          .catch((error) =>
            console.log("--> Error while copy file to device...", error)
          );

My application is using Vue + Ionic, Capacitor v2, and using Filesystem plugins to handle it, but the above problem only occurs on Android 11 (TargetSDK is 30), android lower version is fine. The above function is related to storing the User’s file in the folder where the app was originally set up, to help users if they accidentally delete their original file, they will have a copy as soon as they have imported the file. into the application.

I have given full Read & Write permission to the App but only some files like (JPG, JPEG, PNG, or some other files) are fine, and the files I want to use are not working (. mbtiles, .geojson, .shp, .dxf, .dgn,…)

Please help me to solve the above problem, thank you very much.


App not loading in iOS

$
0
0

Is it also failing if u run it as pwa on ios?

Have ubtried an empty project in capacitor on ios?

Add Cordova plugin in package.json only if ionic Cordova build is android

$
0
0

Recently we used External Cordova plugin that works only for android platform. It is not working for iOS platform and we are facing build fails for the iOS because of the plugin.

Is it possible to add the plugin only for the android platform.

Capacitor filesystem readfile file not found from different pages

$
0
0

Hi all.
I have an issue that I dont understand.
In a page of my android app I copy a file to data directory:

const savedFile = await Filesystem.copy({
          from: filename,
          directory: FilesystemDirectory.Cache,
          to: '421429.1629190715467.jpeg',
          toDirectory: FilesystemDirectory.Data
        });

        const contents = await Filesystem.readFile({
          path: '421429.1629190715467.jpeg',
          directory: FilesystemDirectory.Data,
        });

All works fine. I correctly get the content of the file copied.

Now I want to load this file from another page.
The code is quite simple

testReadFile(filename){
      const contents =  Filesystem.readFile({
        path: '421429.1629190715467.jpeg',
        directory: FilesystemDirectory.Data,
      }).then(
        (content) =>{
          console.log('check existing file ' + JSON.stringify(content));
        }
      ).catch(e =>{
        console.log('check existing file ' + e.message);
      });
    }

but I always get “File not found”

What I’m doing wrong?
thanks

Native Storage with iOs not working

$
0
0

Hello,

I am trying to implement Native Storage on my application. But I can’t store a value.

I followed the tutorial offered by Ionic, but unable to store data during emulation on iOs.

Here is the code :

his.storage.setItem('tokenaccess', {property: this.tokenAccess})
            .then(
              () => console.log('Stored item!'),
              error => console.error('Error storing item', error)
            );
            //this.router.navigate(['/like-page']);
        }

Any ideas to solve this problem ?

Problems with prerendering

$
0
0

If anyone is interested I solved this by running both the build command with the --prerender flag, and the prerender command with the path to the hydrate app script.
So my npm script for building a prerendered site looks like:

stencil build --prerender && stencil prerender dist/hydrate/index.js

Hope this helps someone :pray:

How to make a widget?

App blank when testing on android device

$
0
0

Are there any errors/warnings in the console? Also what is the version of the webview you are using? You can find this by logging window.navigator.userAgent in the dev tools console.


Eslint is linting node_modules only on Ionic Project

$
0
0

Does this happen in an Ionic Vue starter application?

Eslint is linting node_modules only on Ionic Project

$
0
0

@idebeasi I created the above from an ionic vue starter app and before updating eslint and adding prettier package, it was building fine on the build command. But on the linked repo after adding all the prettier packages and config, it just keeps linting the node_modules.

The most confusing thing is the ionic run command which builds the app for the devices works perfectly fine. So the problem appears to be only on the production command.

Eslint is linting node_modules only on Ionic Project

$
0
0

It sounds like updating ESLint/adding Prettier is what is causing the issue. Does the issue still happen if you only updated ESLint without adding Prettier?

Make ionic cards side by side the same height

$
0
0

I have two cards side by side:

<ion-content id="main">
  <ion-grid>
    <ion-row>
      <ion-col size-xs="12" size-md="6">
        <ion-card>
          ...
        </ion-card>
      </ion-col>
      <ion-col size-xs="12" size-md="6">
        <ion-card>
         ...
        </ion-card>
      </ion-col>
    </ion-row>
  </ion-grid>
</ion-content>

how do I make them the same height?

How to make a widget?

$
0
0

As of December 2016, this project is no longer maintained by Microsoft.

I wouldn’t go near this. Hasn’t been updated in 5 years!

Incidentally, I made a widget for Android in Java years ago, it’s not that hard to do. I can share my old code bits if the original poster wants some help.

Make ionic cards side by side the same height

Make ionic cards side by side the same height

$
0
0

By adding a fixed height to the card.


Android Splash Screen visible as keyboard animates

$
0
0

Thanks, that fixes the flash of splash screen. There is still a flash - of black instead - but this is preferable to seeing the words on the splash screen.

Auto fill user and password in InAppBrowser

$
0
0

Hi. I know it’s a security issue but my client has an app where the customers are complaining that everytime they log out of a certain site, when they try to login, there is no autocomplete in the username and password fields. How can I achieve that in InAppBrowser?!?!

Auto fill user and password in InAppBrowser

App blank when testing on android device

$
0
0

i get this in the console:

wbview version:
Mozilla/5.0 (Linux; Android 7.1.2; SM-T560 Build/NJH47B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.92 Safari/537.36

App blank when testing on android device

$
0
0

Your webview is using Chrome 59 which is a pretty old version. I would try updating the webview and see if that fixes the issue.

Viewing all 228535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>