Page 1 of 1

Navegate Issue

Posted: Fri Sep 22, 2017 9:25 pm
by Josiel Denardi6690187

Hi,

I have the start page in project with follow code in load event:

var bemvindo=localStorage.getItem("bemvindo");

if (bemvindo === null)
{
Appery.navigateTo('bv_1',{});
} else {
Appery.navigateTo('login',{});
}

The variable "bemvindo" identifies if the user is using the app
for the first time.

In IOS it's OK, the navigate is running, but in Android, the app call the bv_1 page and the screen appears and after stay white screen.

I need your help urgent!!!!

Thank you and regards.


Navegate Issue

Posted: Fri Sep 22, 2017 10:48 pm
by Bruce Stuart

Hi Josiel,

Well... it could be a number of things - so here's my take:

  1. Assume you are using a jQuery app..... but if not... my advice may be dated.

  2. The correct test for a local storage variable - or any - to detect should be if it has a value in the case of your logic flow....it should not be if it's exactly equal to a specific 'nullifier' ...

    In other words - in my own personal perspective the statements above should be:

    if (bemvindo)
    {
    Appery.navigateTo('login',{});
    } else
    {
    Appery.navigateTo('bv_1',{});
    }

    Reason - I've found that a local storage variable that is undefined - may be 'null' on one platform, 'undefined' on another, and something else on another. The if (variable Name) - means it has some sort of meaningful value - the opposite - not a good - especially with boolean data types.

    So - try reversing the logic.

  3. I don't believe - that Apperyio.navigateTo - requires the 2nd parameter - I'd NOT send it unless you're going to specify values for it. The 'empty' object you are sending as the 2nd parameter - will not evaluate on the receiving side (in the Appery function ) - as undefined (See the discussion above for #2) - and therefore they may be treating it in a different way than if you just don't send it - so - just don't send it unless you intend to give it a value.

    So - this:

    if (bemvindo)
    {
    Appery.navigateTo('login');
    } else
    {
    Appery.navigateTo('bv_1');
    }

    Good luck!

    Best,

    Bruce
    Image


Navegate Issue

Posted: Fri Sep 22, 2017 10:52 pm
by Bruce Stuart

if this still doesn't work - you've tried to see what's going on with Weinre I presume??


Navegate Issue

Posted: Sun Sep 24, 2017 1:00 am
by Josiel Denardi6690187

Hi,

Correct, I belive in you explanation too. Tomorrow I will to test you explanation.

Thank you so much for your attention.

Regards.

PS: Tomorrow I talk to you the tests results.


Navegate Issue

Posted: Tue Sep 26, 2017 5:44 pm
by Josiel Denardi6690187

I did the modification and the issue continue


Navegate Issue

Posted: Thu Sep 28, 2017 5:24 pm
by Serhii Kulibaba

Hello,

Could you print the value "bemvindo" into the Console or with an alert and show us the result?