Immerse SDK
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Starting a Session

Now your project is created and linked in the Immerse SDK window, we need to set up the runtime authentication so the application (build and in the editor) can send report statements to the Immerse platform.

For each of the following methods, you will also need to link your Session Activity to the node. This is used for automated messages that are handled by the SDK.

From Context

The ‘Start Immerse Session from Context’ node will attempt to authenticate the user based on the information the app has on start-up. It is recommended to always attempt to authenticate using this node first and fall back to alternatives in the event that it fails.

In our demo project, we execute this as soon as the app starts by implementing the call on BeginPlay in the GameMode blueprint.

Start Immerse Session from Context node

Start Immerse Session from Context node

If the required data for the supported context is not found or no supported context is available due to the build platform, the node will fail. At this point, alternative authentication methods should be pursued (i.e. Start Immerse Session with PIN).

See below for the available ‘contexts’.

Editor

When the app is running in the Unreal Editor, this node will attempt to join your developer session using the credentials that you used to sign into the Immerse SDK window.

Android Passthrough

When the app is running on an android device, this node will attempt to read values from the android intent, with the assumption that it was launched via an Immerse Launcher or using the SDK’s ‘Launch on Device’ button.

With PIN

As an alternative authentication method, a PIN can be supplied to the ‘Start Immerse Session with PIN’ node. PINs can be provided by the platform or, for testing purposes only, generated from the Immerse SDK window in the Unreal Editor.

Start Immerse Session with PIN node

Events

If your application needs to react to authentication events elsewhere, an event (On Authentication Result) is available in the Immerse Session subsystem that is called when the client authenticates successfully or when it fails. A result for the authentication failure is also provided as an argument pin.

On Authentication Result event handler example. Prints the result on the screen