[Solved] Ionic 4.0.0-beta-19: Native Storage Plugin Error


I am trying to implement the native storage plugin in an Ionic app running 4.0.0-beta.19 on an iOS device.

The error I get when trying to call:

Error: Uncaught (in promise): Error

Here is my implementation:

import { NativeStorage } from ‘@ionic-native/native-storage/ngx’
providers: [ NativeStorage ]


import { NativeStorage } from ‘@ionic-native/native-storage/ngx’;

async canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Promise {

if (this.platform.is("cordova")) {
  const isComplete = await this.nativeStorage.getItem('variable_name');

The error happens on:
const isComplete = await this.nativeStorage.getItem(‘variable_name’);

Can anyone assist on this? Or is the plugin incompatible with this version of Ionic, if so, what are my alternatives?

Solved it, turns out I was trying to use this before the platform was ready.