Displaying user profile information on a custom badge

// Expert user has replied.
B Bob Walker 3 years 7 months ago
4 2 0

I can see where I can set a custom badge for a user but what I want to do is have a default badge which is displayed when I do not have a user logged in and a custom badge when a user is logged in.
 
I want to take the information from the profile and display on the custom badge and share the badge across all users that may use the device.
 
I have searched the programming guide and looked at the toolkit demos but haven't made connection. How can I retrieve this information and populate the html elements on the custom badge?
 
 
Thanks....

Please Register or Login to post a reply

2 Replies

V Venkatasubbaiah Chenna

Hello BobWalker

Are you using login app to set custom badge?

If yes

If you have configured login app you may be calling a asl.auth() function to set custom badge. .

Ex:
asl.auth(true, {
  title : 'Bob Walker',
  apps : '/UserDrive/config/apps.json',
  name : 'Floor Manager',
  pin : '',
  idleTimeout : 60,
  locale : 'en-US'
  });

You can set logout url and in that page set asl.auth(null) to remove the badge

If user logged in this User badge will be displayed.

If No and using a app in app launcher and setting asl.badge(url) in your app the custom badge will be displayed.with this url. Once loggedout you can set asl.badge(null)

If you want to get current logged in user data use asl.getUserData() this function will return the uder information.

Hope this helps.

thanks
Chenna

B Bob Walker

I use:

  asl.auth(true, {
       name:m_employee.getFirstName,
       titl: m_employee.getRole,
       pin: '',
      apps: "http://127.0.0.1:83/UserDrive/config/apps.json",
       idleTimeout: 0,
      badge: "http://127.0.0.1:83/UserDrive/apps/auth/userBadge.html"
});

To set the user.  This works because the badge displayed is now userBadge.html and not defaultBadge.html.

When I attempt to access the user data using asl.getUserData it doesn't appear to be returning any user information. The user object indicates null.

I have my login app configured to 'canOverwriteBadge'.

Do I need to set the profile as well?  I seem to recall reading somewhere that asl.auth sets the profile for you.

Thanks....

CONTACT
Can’t find what you’re looking for?