Skip to content

Ionic2 - Unable to setup SQLStorage (_ionicNative.Storage is not a constructor) #7481

@HamzaLJ

Description

@HamzaLJ

I'm trying to setup SqlStorage in my Ionic2 app, but I was not lucky enough to do so as I am receiving the following error:

I following the documentation, but that didn't work!

_ionicNative.Storage is not a constructor

import {SqlStorage, Storage, StatusBar} from 'ionic-native';

SaveInfo(){

this.storage = new Storage(SqlStorage, { name: 'userInfo' });

return this.http.get(this.postUrl, {search:params})
               .subscribe(
                 data => {

     this.storage.set('userName', 'TestUser');
     this.storage.set('userType', 'VIP');

});

Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.7
Xcode version: Xcode 7.3.1 Build version 7D1014

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions