Page 1 of 1

Show a dialog on first startup?

Posted: Fri Jun 27, 2014 6:41 pm
by Curtis2291707

Hi,

Is there any way to show a dialog on the first startup of the app, but never again? I don't want my first time setup window coming up on every launch!

Thanks!


Show a dialog on first startup?

Posted: Fri Jun 27, 2014 7:30 pm
by Evgene Karachevtsev

Hello Curtis,

You may use local storage variable for this purpose, for example. And depending on its value you can show or do not show the dialog. True set by default. And change to false with first start.


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 7:14 am
by Curtis2291707

Hey Evgene,
Thanks :) also, is there any way to copy and paste elements of the page you're working on?
Thanks!
Curtis


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 7:25 am
by Alena Prykhodko

Hi Curtis,

You can only drag and drop them :)

If you want to use component of the same design on the different pages, save them as Custom and then use wherever you need
http://devcenter.appery.io/documentat...


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 7:43 am
by Curtis2291707

Hi Alena,

OK, thanks for notifying me.

I can't find a way to place in a statement that would say essentially "if my variable is true, show the setup dialog". Could someone enlighten me?

Thanks, it might be a bit of a stupid question!

Curtis


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 10:31 am
by Alena Prykhodko

Curtis,

Let's say you have page pageName where you open dialog dialogName, to do what you what follow these steps:

  1. On pageName Load event add Run JS action with code
    pre
    localStorage.setItem('forDialog','true');/pre

  2. On dialogName Page show event add Run JS:

    prelocalStorage.setItem('forDialog', 'false');
    /pre

  3. Choose event to open dialog, for example on button click. On PageName page add button.

  4. On button Click event add Run JS with
    preif (localStorage.getItem('forDialog') == 'true') {
    Appery.navigateTo('dialogName', {transition : 'pop'});
    }
    /pre


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 11:22 am
by Curtis2291707

Hi Alena,

Thanks so much, this worked! Great service from Appery.io, very pleased!

Curtis


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 11:40 am
by Alena Prykhodko

Nice to hear :)


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 11:40 am
by Curtis2291707

Hey again,

After doing extended testing on a real device, I realised that this code actually makes the dialog come up on every app open rather than just the first one. Any ideas?

Thanks,

Curtis


Show a dialog on first startup?

Posted: Sat Jun 28, 2014 2:16 pm
by Alena Prykhodko

Curtis, this definitely can be done with JS, you can search online for more information.
For instance, http://stackoverflow.com/questions/30...