Page 1 of 1

Navigate page based on login Username

Posted: Thu Feb 28, 2019 2:07 am
by Mohd Izzar

Hi, I would like to do a login, where it will navigate user to their page based on their username. For example, Admin will go to Screen1 and User1 will go to Screen2. How do I achieve this?

I am kinda new with coding. Hope there is some documentation or example regarding this. Thanks!


Navigate page based on login Username

Posted: Thu Feb 28, 2019 2:19 am
by Mohd Izzar

Oh, apparently I just have to add this in my login code:

Apperyio.navigateTo("Screen1", {username:"Maintenance"});

Sorry for the trouble :)


Navigate page based on login Username

Posted: Thu Feb 28, 2019 9:47 am
by Serhii Kulibaba

Hello Mohd,

Please read user's item after the login service, and check the role there.
Here you can find the similar topic: https://getsatisfaction.com/apperyio/...

If you need to navigate the user to the specific page using his role, please use the method prevar nextPage = "";
if (user.role === "admin"){
nextPage = "adminPage";
} else {
nextPage = "defaultPage";
}
Apperyio.navigateTo(nextPage);/pre
here adminPage and defaultPage - pages, need to open for the specific user


Navigate page based on login Username

Posted: Fri Mar 01, 2019 1:31 am
by Mohd Izzar

What if, I want to navigate user using his username? So, I need to change it so, it read the user username?


Navigate page based on login Username

Posted: Fri Mar 01, 2019 2:56 pm
by Serhii Kulibaba

Sure, you can use their names for the navigation, if you have a limited list of users