I am using “open-native-settings” on my ionic 4 project. Based on the documentation https://ionicframework.com/docs/native/open-native-settings#usage My implementation as bellow.
myclass.module.ts:
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
providers:[
OpenNativeSettings
],
myclass.ts file:
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { Platform } from 'ionic-angular';
constructor(
private openNativeSettings: OpenNativeSettings,
private _platform: Platform) {}
inside a method
this._platform.ready().then(() => {
// open settings
this.openNativeSettings.open("about").then(val => {
console.log('success')
});
});
I don't get any compilation errors. But when I call the method, app shows below runtime error.
any suggestions?? Thanks
Found the issue in my case. Since I am using ionic v4.x, I downgraded open-native-settings plugin version to 4.x
npm install @ionic-native/open-native-settings@4
Then import without /ngx. All other codes as same as above
import { OpenNativeSettings } from '@ionic-native/open-native-settings';