Questions tagged [ionic-storage]
90 questions
22
votes
2 answers
Typescript returning boolean after promise resolved
I'm trying to return a boolean after a promise resolves but typescript gives an error saying
A 'get' accessor must return a value.
my code looks like.
get tokenValid(): boolean {
// Check if current time is past access token's expiration
…

user2473015
- 1,392
- 3
- 22
- 47
5
votes
0 answers
Ionic storage Vs sqlite?
I new to ionic 3 where i need to maintain an offline data in the respective storage and persists data when network comes back.
I gone through a lot of research among which one to choose weather to use ionic storage which uses Cordova sqlite in the…

Sukumar MS
- 748
- 1
- 11
- 42
5
votes
1 answer
Ionic 3 Wait for storage promise to completely finish before running function
I’m trying to get data from the server using token from ionic storage. The problem I’m experiencing is when the get token promise can’t retrieve the token on time. Therefore, whenever I reload or reopen the app it sometimes return with an…

Rendell Lasola
- 243
- 2
- 6
- 14
4
votes
0 answers
Ionic Storage Issue for less memory space
I am using ionic storage in my app and It needs almost 1GB device space to launch the app.
If device memory is not having at least 1GB of space app will not be launched. After clearing that memory I am able to launch.
this the way, I am trying to…

MALAY NIRAV
- 41
- 5
3
votes
0 answers
index.js depends on 'localforage'. CommonJS or AMD dependencies can cause optimization bailouts
I got this warning, but I dont understand why 'localforage' depends on CommonJS. I had googled for few days, but I can't find any solution that fit with my problems.
WARNING
C:\xxx\node_modules\@ionic\storage\dist\esm\index.js depends on…

qwerty
- 45
- 4
3
votes
0 answers
Cannot find name 'List'? (Ionic - Angular) when using ViewChild
I am receiving the aforementioned error when trying to use an ion-list in the following context:
My Imports:
import { AddNamePage } from './../add-name/add-name.page';
import { MainService, User } from './../services/main/main.service';
import {…

SeventhWarhawk
- 1,313
- 7
- 18
3
votes
2 answers
Get Ionic storage item as a string
As said in the title my problem is when I do:
this.storage.get('user')
I get this object
t {__zone_symbol__state: null, __zone_symbol__value: Array(0)}
and I don't know how to manipulate it.
I'm asking if there is a way to get a string value from…

khaled djellal
- 99
- 1
- 9
2
votes
2 answers
How use * ngIf to display a button if the key exists in ionic storage
I working on a App that pulls simple online, json below.
json
this.itemList = {
"list": [
{
title: "Power Audit",
text: "666",
textTwo: "",
Type: "auditform-main",
link: this.linkOne
},
{
title:…

Thomas Degroot
- 441
- 1
- 12
- 32
2
votes
2 answers
Storage not persistent using Ionic Storage
I am attempting to utilize the Ionic Storage library to keep track of settings for my app. However, I am having an issue where each time the app is restarted, the storage is wiped. At least, it appears that way.
I'm storing the…

dennisdenhollander
- 21
- 1
2
votes
1 answer
Ionic storage get returns a promise "Bearer [object Promise]" How to return a value and use it as authorization token?
Ionic storage.get('token').then() function returns a promise so it is returning a promise object instead of the refresh token.
I am working on a Ionic 4 angular project where I am using JWT for authentication. Using the HTTP interceptor I was able…

Reactive_learner
- 417
- 1
- 4
- 21
2
votes
2 answers
Uncaught (in promise): QuotaExceededError Ionic 3
Already StackOverflow have this type question but none of the answers is helpful for me,
Here is my problem details-
Getting error when I build the app in android device, its work fine in emulator and browser, but when I run the app into the device…

Md Alamin
- 1,084
- 11
- 19
2
votes
1 answer
ionic storage module giving OpaqueToken error with angular 5
I have updated my ionic project to angular 5 and i got the below error with many ionic native plugins..
angular/core/core"' has no exported member 'OpaqueToken
Resolved all of the issues after updating to the latest version , except for…

Arjun T Raj
- 3,187
- 1
- 21
- 44
2
votes
2 answers
IONIC 3 new local storage
I want to create a new localstorage in my ionic app (IONIC 3), but I've looked many ways to do that. I currently have this:
database.ts (my provider)
import { HttpClient } from '@angular/common/http';
import { Injectable } from…

Oscar Acevedo Osses
- 93
- 3
- 10
2
votes
0 answers
Ionic interceptor utilizing refresh tokens using sqLite async storage
I have successfully developed an angular2 interceptor utilizing refresh tokens (refreshing the token and then retrying the http request) in which the access_token and refresh_token are both stored in the localStorage.
The following is the code for…

Behrooz
- 1,895
- 4
- 31
- 47
2
votes
2 answers
Ionic Storage undefined in promise?
I have an Ionic 2 app that shows the user Items inside Packages in the form of a list. I created a function that retrieves the current Item index inside a Package, it is fired the user launches the app. It checks if the index name-value pair in…

Voyna
- 33
- 6