Android running black screen after integrate LOCALSTORAGE

Android running black screen after integrate LOCALSTORAGE
0.0 0

#1

Hello All game developer,

My game working fine so far. But when I am integrating with cc.sys.localStorage API, black screen problem coming up on my android device and web browser. it worked just only my simulator on mac. So what is the problem? can anyone help me?
I am using cocos creator 1.5.1.

thank,


#2

Hi,

what does the browser console contain? Do you get error messages?

Best regards,
Zsolt


#3

Hi PZsolt27,

Now I know the problem is because of getting value from storage.
My code and console:
JSON.parse(cc.sys.localStorage.getItem(“point”)).amount return massage ‘read property ‘amount’ of null’
JSON.parse(cc.sys.localStorage.getItem(“point”)) return null.

My question is why simulator work fine and value return fine but on browser got error like above.

thanks,


#4

Sorry my bad.
It worked now.


#5

What was the problem/solution?

Thanks


#6

Hello efares,

That was my mistake.
Problem: I’m kinda set default key and value when application take a first running. so i made a condition if storage.key is null default data is set in and I tested first in simulator it worked. and then I changed condition data !== null (I just want to test something else and I was going to change it back but I forgot). simulator still worked because default data already set but another platform.
Solution: changed it back.

Hope u get it. that was completely my mistake.
thank.