What Happens When Something Isn’t Primed (Preloaded)
Create Components with Offline Analysis In Mind
Determine Online or Offline Status
Previous Versions
The offline environment presents a number of technical challenges for LWC Offline-enabled mobile apps, and for your Lightning web components.
Salesforce mobile apps are heavily optimized for offline use. These optimizations are enabled by our complete understanding of how the built-in features are implemented, including code, data, and metadata relationships. The app contains or loads the information it needs for built-in features to perform well, online and offline. See the following topics in Salesforce Help for application-specific details.
Salesforce mobile apps don’t, and can’t, have this same level of knowledge about your custom features built with Lightning web components. Instead, the app analyzes your custom objects, page layouts, components, and other metadata, and then loads the data and metadata it thinks you need. To improve the quality of this analysis, and thus the performance of your components, you must follow a number of guidelines when developing your Lightning web components.
What Happens When Something Isn’t Primed (Preloaded)
Priming for offline use is a “best effort” mechanism. Salesforce mobile apps are resilient in situations where resources are required by a mobile client but weren’t primed.
Create Components with Offline Analysis In Mind
To use a feature implemented with Lightning web components while offline, it must be preloaded, or primed, before you go offline.
Determine Online or Offline Status
The Salesforce Mobile app, Field Service Mobile app, and Lightning Web Components generally, don’t have a supported mechanism for detecting whether a device is online or not. This is by design.