Preloading

How to use preloading on native app environments

With the default implementation, the Experience will load when it is shown to the user, but if you are aiming to reduce the loading time, you can trigger proactive loading so that it’s ready to go when the user wants to see it.

Note: This feature is not yet available in the Javascript SDK.

Use the following snippet:

let experience = Launcher.getExperience()

// At this point the experience will already be loading in the background
// You could now store it in memory until you need to embed it in your UI.

// Please note that this may consume resources, so be careful about how many
// Experiences you preload.

// Eventually...
<yourView>.addSubview(experience)

// You need to ensure the experiences are laid out however you see fit.
// For instance, could use autolayout constraints, or setting 
// their frame

Last updated

Was this helpful?