Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Local storage not working on iOS device

$
0
0

@abhisheklamrood wrote:

Hi,
I am using local storage in my application, which works very well on the browser and on the android device, but it is not working on iOS device.

Below is the code .
First page for setting data

this.storage.set('userData', {
          userName: response.userName,
          userId: response.userId,
          adminId: response.adminId,
          adminName: response.adminName,
          roleId: response.roleId,
          roleName: response.roleName,
          action: response.action,
          adminRoleName:response.adminRoleName
        });

Second page for getting the data.

getLocalData() {
    this.storage.get('userData').then((data) => {
      this.userId = data.userId;
      this.roleName = data.roleName;
      this.action = data.action;
      console.log("userId ", this.userId);
    })
  }

Data is set on button click in the first page and the getLocalData() method is called in the constructor of the second page. But when running on iOS device this method is not called, so I am not able to get the details. I have debugged using the safari dev tools, but no success so far.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles