I Install Native Storage By run these commands
$ ionic cordova plugin add cordova-plugin-nativestorage
$ npm install --save @ionic-native/native-storage
And I have Import Native Storage in app.module.ts
•••••
import { NativeStorage } from '@ionic-native/native-storage';
•••••
/* SOME CODE*/
providers: [
•••••
NativeStorage
•••••
]
And I use it in my HomePage (/pages/home/home
)
•••••
import { NativeStorage } from '@ionic-native/native-storage';
•••••
constructor(private nativeStorage: NativeStorage) {}
/* SOME CODE */
ngOnInit(){
this.nativeStorage.setItem('myitem', {property: 'value', anotherProperty: 'anotherValue'})
.then(
() => console.log('Stored item!'),
error => console.error('Error storing item', error)
);
}
But after all these steps I got error in the console
my Question is What do I do to avoid this Error Error storing item cordova_not_available