AppMachine Help Center

How can we help you?

Follow

Show user and device options in your app

As an app builder you would like to know which user is logged into your app or maybe even want to know what for device they are using with what OS.

Well now you can, we offer different options to get to know your clients a little bit better.

USER

{user:id}

{user:email}

{user:name}

{user:role}

 

In Javascript block

- App.User.id
- App.User.name 
- App.User.email 

 

Example:

 <label value="{user:id}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{user:email}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{user:name}" margin="5" maxlines="auto" fontsize="14" />
<label value="{user:role}" margin="5" maxlines="auto" fontsize="14" />

Output:

1421492084

johnny@appmachine.com

Johnny Smith

Unauthorized 

 

DEVICE

{device:id}

{device:version}

{device:platform}

{device:currentdate}

{gps:latitude}

{gps:longitude}

 

Example:

 <label value="{device:id}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{device:version}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{device:currentdate}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{device:latitude}" margin="5" maxlines="auto" fontsize="14" />
 <label value="{device:longitude}" margin="5" maxlines="auto" fontsize="14" />

Output:

iPhone
{device:id} --> 871033006

{device:version} --> iOS iPhone OS 9.1

{device:platform} --> iOS

{device:currentdate} --> 2/8/2016 12:00:11 PM

{gps:latitude} --> 52.960561

{gps:longitude} --> 5.920522


Android
{device:id} --> 1013362098

{device:version} --> Android 4.1.2

{device:platform} --> Android

{device:currentdate} --> 2/8/2016 12:00:11 PM

{gps:latitude} --> 52.960561

{gps:longitude} --> 5.920522

You can pass these field in a web service for example or just show them in a label or send them in a form. You can also filter in your web service like this:

 

 

 

 

 

Was this article helpful?
3 out of 3 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Jeffthegeek

    if no user is logged in and you use {user.email} what would it return?

  • Avatar
    Johnny Boersma

    Hello Jeff,
    It would return nothing since the property is empty.

    Kind regards,

  • Avatar
    Georges Andy Rene

    how can we return the user Phone number ?
    This is a mobile app hence each user has a phone number .. why can't we show user phone with {user:phoneNumber}

  • Avatar
    Calvin

    Is it possible to get just the first name of the user?