Open-native-settings on Ionic 3 Project

I stuck for days trying to make it work “open-native-settings” on my ionic 3 project,.

So, following the documentation,

add this on app.modules.ts:

import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';

and add OpenNativeSettings in providers list.

Then en my .ts file:

import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';

Adding on constructor:

constructor(private openNativeSettings: OpenNativeSettings) { }

but when trying call open() method I get:
(…) is not a function. (???)

this plugin work fine on Ionic 3??

Why I see /ngx to the end of import line???

I need try this on Ionic 3, not Ionic 4.

any suggestions??

Thanks.

The /ngx is only for ionic v4.
Just use the normal method.

import { OpenNativeSettings } from ‘@ionic-native/open-native-settings’;

I try it, but i get an syntax error on app.modules.ts highlighting on OpenNativeSettings on the providers list. :frowning:

When you run, did you get any errors or only on editor?

On editor i get this:

and this:

trying run the app I get hundred of errors, obviously.

What is wrong??

I following this video, my source code is identical:

But doens’t work in my case.

Ok, I think that the problem is with ionic native, first uninstall it (keep the import in .ts files)

npm uninstall @ionic-native/open-native-settings

Then install the correct ionic-native for open native settings:

npm install --save @ionic-native/open-native-settings@4

I think it will fix your errors.

1 Like

YOU ARE THE BOSS!! it worked!!

what does @4 mean at the end of the command?

In fact I have exactly this same problem with another plugin (clipboard)

Thanks!!

1 Like

Actually don’t know why it is @4 if is for ionic 3… :grinning:
But for clipboard just do the same

npm install --save @ionic-native/clipboard@4

Just for the record, here is the ionic native v3 docs - https://ionicframework.com/docs/v3/native/

2 Likes