Ionic native file plugin and permissions in browser app


Hi all,

first of all: I really do enjoy working with ionic… thanks for that nice framework :slight_smile:

Today I encountered a problem which makes me a bit helpless. The scenario is: We are developing an app for both mobile and browser (single source). In the app initialization we load a configuration file: On mobile we make use of the @ionic-native/file/ngx plugin to access the mobile filesystem. On browser we just fetch a file from the assets folder. Therefore we made a configuration service which checks the platform and then calls the corresponding file-loading method.

Now the problem: Since we include the Native File Plugin, the desktop/browser user gets a security popup to confirm that the app wants to access the local filesystem. But the app running in the browser does not need file access, since the config file is located on server side. Is there any possibility to prevent this security popup? Something like importing the plugin only if on mobile platform?

I would be very thankful for any idea since we somehow must avoid this popup.