Mobile: What Is The Restart WalkMe API and How Is It Used?
Brief Overview
Supported from SDK version 1.13.0, the Restart WalkMe API lets app developers better tailor WalkMe to their needs and control the timing of WalkMe's session and content sync.
The default WalkMe Mobile SDK behavior for sessions and content sync is as follows:
- The SDK syncs campaigns and Rule Based Goal content whenever the app process is started (as long as there is internet connectivity; otherwise offline mode kicks in);
- A new WalkMe session is started every time the end user starts the app, whether or not it was already open in the background.
This default behavior will suffice for most apps, but there are some apps with unique use cases that need more control over sessions or syncs.
For example:
- Apps that are constantly in the foreground (such as point-of-sale apps) will need to proactively let WalkMe know what to consider as a new session;
- Apps that keep their processes alive while the app is in the background for hours or days may want to proactively sync content to make sure users have the most up-to-date content (instead of counting on end-users to manually kill the processes for WalkMe to sync).
The Restart WalkMe API will perform a content sync and new session initialization whenever called, but we recommend adding it where it makes the most sense from an end-user-usage perspective, and according to the use case.
Examples include the following:
- When the app moves to the foreground;
- When a user logs in; and
- When a definitive process such as a sales process is completed.
Steps For Implementing the Restart WalkMe API
The Restart WalkMe API can be called using the following API:
Android
/** * Restarts WalkMe session and syncs content. * * This method can only be called after {@link #start(String, String, Application)} was already called. * Restarting the session is allowed if old session is at least 1 minute old. */ public static void restart()
iOS
/** * Restarts WalkMe session and syncs content. * * This method can only be called after {@link #start(String, String, Application)} was already called. * Restarting the session is allowed if old session is at least 1 minute old. */ + (void)restart;