Understand the Mobile Development Cycle
Debug Mobile Components
Integrate Native Device Capabilities with Mobile Skills
Validate LWCs for Offline Use with Mobile Skills
Previous Versions
Use the mobile-platform-native-capabilities-integrate skill to build Lightning web components (LWCs) that use native mobile device features, such as the barcode scanner, biometrics, location, and NFC, through the lightning/mobileCapabilities module. Describe the capability you want in natural language, and the skill wires the service into your LWC with the correct availability checks, error handling, and current APIs.
The lightning/mobileCapabilities module exposes factory functions that return service objects for native device features. Each service extends a common base capability that includes an isAvailable() method, so your component can degrade gracefully on surfaces where the capability isn’t present, such as desktop and mobile web. Instead of requiring you to memorize each service’s API, the skill routes your AI agent through three steps. The agent chooses the right capability, loads the authoritative type definitions, and wires the service into your LWC with the correct availability gating, error handling, and current API choices.
In Agentforce Vibes, this skill is available out of the box. In other AI coding environments, install it by running npx skills add https://github.com/forcedotcom/sf-skills --skill mobile-platform-native-capabilities-integrate. For installation details and environment requirements, see Install Mobile Skills.
Note
Use this skill when you want an LWC that:
The skill supports the native device capabilities exposed by the lightning/mobileCapabilities module.
| Capability | Use Case |
|---|---|
| App Review | Prompt the user for a native in-app review. |
| AR Space Capture | Capture a 3D scan of a physical space using augmented reality. |
| Barcode Scanner | Read QR, UPC, EAN, Code 128, and other barcode types from the camera. |
| Biometrics | Authenticate with Face ID or a fingerprint. |
| Calendar | Read or create events on the device calendar. |
| Contacts | Read or create entries in the device address book. |
| Document Scanner | Scan paper documents using the camera with edge detection. |
| Geofencing | Trigger logic when the device crosses a geographic boundary. |
| Location | Read GPS coordinates and watch for updates. |
| NFC | Read or write NFC tags. |
| Payments | Take an Apple Pay or Google Pay payment. |
When you describe the device feature that you want, the skill:
import from lightning/mobileCapabilities, an isAvailable() gate before every call, the current, non-deprecated entry point, and typed error handling for each failure code.Native capabilities are available only when the LWC runs inside a supported Salesforce mobile app, such as the Salesforce mobile app or the Field Service mobile app. When the same component renders on desktop or mobile web, the factory function still returns an object, but isAvailable() returns false. The skill gates every capability call behind an isAvailable() check so that your component degrades gracefully on unsupported surfaces.
Each service defines its own failure-code enum, such as BarcodeScannerFailureCode or LocationServiceFailureCode. The skill maps each rejection path to a user-actionable outcome. For example:
After you describe the capability, the skill identifies the matching service, loads its reference, and wires it into your component with the correct availability checks and error handling.
For LWCs that ship in offline mode, use the mobile-platform-offline-validate skill to review your component for offline-priming compatibility.