Reputation: 145
My ionic app doesn't work on IOS, but it works on android and browsers like chrome and safari. The only error reported is when starting the application regarding storage creation. Why can't I use storage on IOS? How can I solve it?
Error:
core.js:6014 ERROR Error: Uncaught (in promise): Error: No available storage method found.
NgModule:
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
BrowserModule,
IonicModule.forRoot(),
IonicStorageModule.forRoot({
dbKey: '_ionickey',
driverOrder: ['IndexedDB', 'WebSQL', 'localstorage'],
name: '_ionicstorage',
storeName: '_ionickv'
}),
AppRoutingModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
bootstrap: [AppComponent]
})
Upvotes: 5
Views: 8849
Reputation: 6347
For me, I simply had to delete the driverOrder
property from the IonicStorageModule.forRoot
argument object, leaving just name
:
IonicStorageModule.forRoot({ name: '_office_planner'})
Upvotes: 1
Reputation: 41
Below solution is working fine for me. Please add below code in the app.module.ts
import { Drivers } from '@ionic/storage';
IonicStorageModule.forRoot({
name: '__mydb',
driverOrder: [Drivers.IndexedDB, Drivers.LocalStorage]
}),
Upvotes: 4