@jfsoftwarellc wrote:
Converting my v3 app to v4 and stopped up at getting SecureStorage to work. Currently testing in the browser so not sure if this is just browser specific or not but in v3 it worked on any platform.
Full error from the browser console:
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[SecureStorage]: StaticInjectorError(Platform: core)[SecureStorage]: NullInjectorError: No provider for SecureStorage!
Haven’t done anything beyond installing the plugin
ionic cordova plugin add cordova-plugin-secure-storage
npm install @ionic-native/secure-storageand then importing it adding it to the constructor per the docs page
import { SecureStorage, SecureStorageObject } from '@ionic-native/secure-storage/ngx'; constructor(private secureStorage: SecureStorage) { }
Not even 100% sure why it’s showing the platform as core instead of browser. I tried messing with the securestorage.js file in /plugins/cordova-plugin-secure-storage/www to add ‘browser’ and ‘core’ to the array of supported platforms, then adding an if statement on browser or core to overwrite the SecureStorage prototype with the plugin code form v3 that uses localStorage but that didn’t seem to do anything at all so I reverted it.
Posts: 2
Participants: 1