How to set up a project with your an authentication token.
Creating the ArdkAuthConfig
In order to use the networking and awareness features of ARDK, an authentication token must be fetched from the ARDK servers.
The following steps need to be repeated for each project that uses ARDK.
Create a Resources/ARDK directory inside your project’s Assets directory and add an
ArdkAuthConfigasset to it. Do not change its default name.
If you’ve imported the ARDK-Examples package into your Unity project, delete the empty ArdkAuthConfig asset that already exists in the Assets/ARDKExamples/Resources/ARDK folder as well. If your project has multiple ArdkAuthConfigs, ARDK will print the following warning to the Unity Console window: “There are multiple ArdkAuthConfigs in Resources/ARDK/ directories, loading the first API key found. Remove extra ArdkAuthConfigs to prevent API key problems”.
Api Keyfield in the
ArdkAuthConfig.assetwith any API key generated through your Lightship.dev account.
To ensure your app is using the correct key, restart Unity.
Verifying Your Setup
To verify that your API key is valid and set up properly, try out the LowLevelNetworking scene in the ARDK-Examples Unity project.
NetworkSessionManagercomponent, located on the ExampleManager object in the scene hierarchy.
NetworkSessionManager’s RuntimeEnvironment property to
Enter Play Mode.
Click the Init button and then the Connect button in the Game View window.
If authentication succeeds, the connection to ARDK servers will succeed as well and you will see the log message: “Connected as Host”
If authentication fails, you will see a “Connection Failed” log error message with an error code of
700(your API key is invalid) or
701(your API key isn’t properly set in your ArdkAuthConfig)
Verification of authentication in the Unity Editor currently only works on Intel Macs. If using a different development platform, you must deploy your ARDK app to a mobile device in order to verify that authentication has been set up properly. Logs can be viewed by clicking the Toggle Log button.