Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Navegate Issue

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.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Navegate Issue

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

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Navegate Issue

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

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Navegate Issue

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.

Josiel Denardi6690187
Posts: 0
Joined: Mon Feb 24, 2014 9:23 pm

Navegate Issue

I did the modification and the issue continue

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Navegate Issue

Hello,

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

Return to “Issues”