Function get of storage not working on real device

Here is my snippet code;
ex; following func, its in AAAService
async loadStorage() {
const val = await this.storage.get(‘appInfo’);
if (val == null || val == undefined) { return; }
let appInfo = JSON.parse(val);
console.log(appInfo);
}

const info = await this.aaaService.loadStorage();.

const val = await this.storage.get(‘appInfo’);
Actually above code works on browser but not working on real device such as Android and iOS. It`s so urgent and anybody help me ?

Thanks.

In your case, you are not returning appinfo.

const info = this.loadStroage();
loadStroage(){
this.storage.get("appInfo").then(res=>{
    if(res){
     console.log(res);
  return res;
    }else{
   return;
}
 })
}

I just followed your code but seems not working. no log in console.

chk in your application tab that data is present over there or not

or else share your code

if you are using sqllite plugin then remove it
ionic cordova plugin rm cordova-sqlite-storage

it will work perfectly without the sqlite plugin

I followed your instructions but not working.


image

I didn`t find why get func of storage not working and solved it myself but used the window.localstorage.