ArborXR Public Device API

How to use our public device API

The public SDK facilitates communication between the ArborXR client app and processes running on the same device. Native applications can integrate directly with our ISdkService.aidl interface. Unity applications integrate our SdkBehaviour class (see “Example Unity Script” below).

Setup

  • If you are using Unity 2019.x or lower
  • Download the Unity Package here
  • Adding package to a Unity project
    1. While in a Unity Project, open Window > Package Manager
    2. From the add package button + (top left), select add package from disk
    3. Navigate to and select the package.json file, and open

API Definition

  • getDeviceId()

    • Return Type: string
    • Description: UUID assigned to device by ArborXR
  • getDeviceTitle()

    • Return Type: string
    • Description: Title given to device by admin through the ArborXR Web Portal
  • getDeviceSerial()

    • Return Type: string
    • Description: Serial assigned to device by OEM
  • getDeviceTags()

    • Return Type: string array
    • Description: Tags added to device by admin through the ArborXR Web Portal
  • getOrgId()

    • Return Type: string
    • Description: The UUID of the organization where the device is assigned. Organizations are created in the ArborXR Web Portal.
  • getOrgTitle()

    • Return Type: string
    • Description: Name assigned to organization by admin through the ArborXR Web Portal
  • getOrgSlug()

    • Return Type: string
    • Description: Identifier generated by ArborXR when admin assigns title to organization
  • getMacAddressFixed()

    • Return Type: string
    • Description: physical MAC address assigned to device by OEM
  • getMacAddressRandom()

    • Return Type: string
    • Description: randomized MAC address for the current WiFi connection
  • trackUserExperience(UserExperience experience)

    • Return Type: void
    • Parameter: UserExperience
    • Description: use to track a user experience following the xAPI standards. (See below for more detail)
  • getIsAuthenticated()

    • Return Type: boolean
    • Description: whether the device is SSO authenticated
  • getAccessToken()

    • Return Type: string
    • Description: the SSO access token
  • getRefreshToken()

    • Return Type: string
    • Description: the SSO refresh token
  • getExpiresDateUtc()

    • Return Type: datetime
    • Description: when the SSO access token expires in UTC time

Example Unity Script

using XRDM.SDK.External.Unity;

public sealed class ExampleScript : SdkBehaviour
{
  protected override void OnEnable()
  {
    base.OnEnable();
    base.Connect(new SampleCallback());
  }
  
  private sealed class SampleCallback : IConnectionCallback
  {
    public void OnConnected(ISdkService service)
    {
      var deviceId = service.GetDeviceId();
    }
    
    public void OnDisconnected(bool isRetrying) { }
  }
}

Tracking User Experiences

The SDK interface provides a function, trackUserExperience, for tracking user experiences following the xAPI standard. The function takes one parameter, UserExperience with the following structure:

type UserExperience {
    String actor;
    String verb;
    String object;
}

Since there is no universal standard for the actor, verb, and object fields, we’ve opted to represent them as strings. This way, SDK users can serialize their data according to the standards set by their target system’s specifications.


Last modified October 18, 2022: Include namespace in C# example. (fccca06)