Re: [codenameone-discussions] Push key is null

2021-05-20 Thread Shai Almog
I saw in the other thread you use preferences.clearAll(). That would pretty much explain your problem... On Friday, May 21, 2021 at 7:56:25 AM UTC+3 Shai Almog wrote: > You have this: if (!Preferences.get("setIt", false)) which indicates you > don't call it every time. > However,

Re: [codenameone-discussions] Push key is null

2021-05-20 Thread Shai Almog
You have this: if (!Preferences.get("setIt", false)) which indicates you don't call it every time. However, Push.getPushKey() should work and never turn back to null unless you wipe something from storage/preferences. Is there some other code that encrypts, wipes, logs out etc? On Thursday, May

Re: [codenameone-discussions] Push key is null

2021-05-20 Thread Hannah R
Thank you for your responses. *Have you tried delaying getting the token a bit? CN1's native code does this thing where it tries to get the token once and then if not available it waits a few secs and tries again* - Thank you, I'll do that. Worth to try. *You need to call register for push

Re: [codenameone-discussions] Push key is null

2021-05-19 Thread Shai Almog
You need to call register for push every time the app loads. Not just the first time. So even if it fails the first time the app loads it should work the second time. On Thursday, May 20, 2021 at 12:52:26 AM UTC+3 javier...@gmail.com wrote: > (only a user like you) > > Have you tried delaying

Re: [codenameone-discussions] Push key is null

2021-05-19 Thread Javier Anton
(only a user like you) Have you tried delaying getting the token a bit? CN1's native code does this thing where it tries to get the token once and then if not available it waits a few secs and tries again Something along these lines: (hope I don't confuse you more than help you)

[codenameone-discussions] Push key is null

2021-05-19 Thread Hannah R
Hello, I have the following issue: In Android 7.0, when getting Push.getPushKey() (not in registeredForPush() method) the first time, it's null. I have *callSerially(() -> registerPush());* in my start() method and besides that, I added * if (!Preferences.get("setIt", false)) {