Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

localStorage not working on hybrid app

Rubén García TerceroMay 29 2019 — edited May 30 2019

Simply, localStorage isn't working on my application.

When serving the application on the browser (ojet serve --browser) it works just fine, but when I build the apk and install it on my phone it doesn't work.

let credenciales=window.localStorage.getItem("login");

          if(credenciales!=undefined && credenciales!=null && credenciales!="undefined"){

              credenciales=JSON.parse(credenciales);

              app.user(credenciales.name);

.

.

.

.then(text=>{

                app.user(self.name());

                window.localStorage.setItem("login", JSON.stringify({"name":self.name(),"role":text}))

Code doesn't have much to look at.

Comments
Post Details
Added on May 29 2019
2 comments
238 views