Lightweight SDK Sample App Walkthrough

The LSDK sample demonstrates how to send Motive Insights data using the LSDK Reporter.

void Start() { Reporter.Instance.ApplicationStart(); if (LaunchInput) { LaunchInput.SetActive(false); } if (SessionScreen) { SessionScreen.SetActive(false); } StartCoroutine(WaitAppReady()); }

On start we send the Application Start report and disable the screens in the sample app. Start a Coroutine that waits for the Launch Service to be ready.

private IEnumerator WaitAppReady() { while (!AppSetup.Instance.IsReady) { yield return null; } AppReady(); }

Polls the IsReady flag on AppSetup to ensure the LSDK has completed its configuration.

void AppReady() { if (!LaunchSessionManager.Instance.IsSessionReady) { if (LaunchInput) { LaunchInput.SetActive(true); } StartCoroutine(WaitSessionReady()); } else { SessionReady(); } }

Once the app has completed configuration, it will either have a configured session (meaning you can start sending reporting data), or will need to initiate a session with a Launch Code. (Note that apps Launched From Launch Pad should always have a configured session.) In the case that there is no session, we display the Launch Input screen to collect a Launch Code from the user. We start a Coroutine that waits for the session to be ready.

Poll IsSessionReady.

This code shows how to submit a Launch Code entered by the user to Launch Server and how to configure the Session. Again, this code should not be required for apps launched directly via Launch Pad, but is useful for testing.

When the session is ready, send the Start Session and Scenario Started reports. Hide the Launch Input screen and show the Session Screen. The Session Screen is a simple UI that allows you to test various pre-configured Reporter messages.

It is crucial to send the Start Session and Scenario Started reports at the beginning of a Scenario in order for the Insights pane to interpret the data.

Reports that can be generated by Launch Server:

Assessments

Assessments are collected by Insights for specific tasks within the context of a Scenario. Note that these do not map to the final Scenario results that are sent to SCORM. Scenario Result is described in the next section.

  • Score: A scaled score (i.e. 8/10)

  • Completion: Whether the learner completed a task

  • Success: pass/fail for a task

Scenario Result

This reports the overall result for a Scenario. It includes the same properties as assessments, but grouped together in a single message. These results can be reported back to an LMS via SCORM.

Example code for uploading an image file taken from a screen grab in the app. This is reported to Launch and viewable in Insights.

Additional reporting on pause/shutdown.