forcedotcom/sf-skills / plugins/builder/mobile-development/skills/mobile-platform-native-capabilities-integrate
mobile-platform-native-capabilities-integrate
VerifiedBuild a Salesforce LWC that uses native mobile device capabilities — barcode scanner, biometrics, location, NFC, calendar, contacts, document scanner, geofencing, AR space capture, app review, and payments. Use this skill when the user asks for an LWC that scans a barcode, captures a photo of a document, reads location or geofences, prompts for biometrics, reads/writes the device calendar or contacts, taps NFC, takes a payment, prompts for an app review, or scans an AR space. Also triggers on "lightning/mobileCapabilities", "mobile capability", "Nimbus", "device capability". Do not use for mobile offline / Komaci priming reviews (use `mobile-platform-offline-validate`) or for picking generic Lightning base components (use `design-systems-slds-apply`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.6 KB |
| references/app-review.md | markdown | 2.2 KB |
| references/ar-space-capture.md | markdown | 3.3 KB |
| references/barcode-scanner.md | markdown | 8.1 KB |
| references/base-capability.md | markdown | 651 B |
| references/biometrics.md | markdown | 3.9 KB |
| references/calendar.md | markdown | 7.3 KB |
| references/contacts.md | markdown | 6.9 KB |
| references/document-scanner.md | markdown | 9.7 KB |
| references/geofencing.md | markdown | 4.2 KB |
| references/location.md | markdown | 5.4 KB |
| references/mobile-capabilities.md | markdown | 2.1 KB |
| references/nfc.md | markdown | 7.5 KB |
| references/payments.md | markdown | 2.9 KB |
references/biometrics.md
View on GitHub# Biometrics Service Grounding Context
The following content provides grounding information for generating a Salesforce LWC that leverages biometrics scanning facilities on mobile devices. Specifically, this context will cover the API types and methods available to leverage the face recognition and the finger printing scanner of the mobile device to authorize the user, within the LWC.
## Biometrics Service API
```typescript
/*
* Copyright (c) 2024, Salesforce, Inc.
* All rights reserved.
* For full license text, see the LICENSE.txt file
*/
import { BaseCapability } from '../BaseCapability.js';
/**
* Use this factory function to get an instance of {@linkcode BiometricsService}.
* @returns An instance of {@linkcode BiometricsService}.
*/
export function getBiometricsService(): BiometricsService;
/**
* Access a device’s biometrics capabilities from a Lightning web component.
* @see {@link https://developer.salesforce.com/docs/platform/lwc/guide/reference-lightning-biometricsservice.html|BiometricsService API}
*/
export interface BiometricsService extends BaseCapability {
/**
* Verify if the biometrics hardware or pin code is available to use to verify the user’s device ownership.
* @param options A {@linkcode BiometricsServiceOptions} object to configure the {@linkcode BiometricsService} request.
* @returns A Promise object that resolves as a Boolean value. True if the biometrics hardware or pin code is available for use and false otherwise.
*/
isBiometricsReady(options?: BiometricsServiceOptions): Promise<boolean>;
/**
* Verify if the user is the device owner using the device’s biometrics hardware or pin code.
* @param options A {@linkcode BiometricsServiceOptions} object to configure the {@linkcode BiometricsService} request.
* @returns A Promise object that resolves as a Boolean value. True if the user is the registered device owner and false otherwise.
*/
checkUserIsDeviceOwner(options?: BiometricsServiceOptions): Promise<boolean>;
}
/**
* An object for specifying which instances of a recurring event are affected by an update to or deletion of one instance of the event.
*/
export interface BiometricsServiceOptions {
/**
* Reason to use biometrics scanner.
*/
permissionRequestBody?: string;
/**
* Title used in the dialog when the reason text is displayed. Allowed on iOS, but effective only on Android.
*/
permissionRequestTitle?: string;
/**
* Policies specified in the array allows customization of the biometrics scan behavior.
*/
additionalSupportedPolicies?: BiometricsServicePolicy[];
}
/**
* An object representing policy to use pin code as an alternative to biometrics.
*/
export type BiometricsServicePolicy = /** User cancelled the operation. */ 'PIN_CODE';
/**
* An object representing an error that occurred when accessing {@linkcode BiometricsService} features.
*/
interface BiometricsServiceFailure {
/**
* A value representing the reason for a biometrics service error. See {@linkcode BiometricsServiceFailureCode} for the list of possible values.
*/
code: BiometricsServiceFailureCode;
/**
* A string value describing the reason for the failure. This value is suitable for use in user interface messages. The message is provided in English and isn’t localized.
*/
message: string;
}
/**
* Correlates with the code property on the {@linkcode BiometricsServiceFailure} object.
*/
type BiometricsServiceFailureCode =
| 'HARDWARE_NOT_AVAILABLE' // There is no fingerprint scanner or face recognition hardware found.
| 'NOT_CONFIGURED' // Biometrics hardware was found but has not been set up yet.
| 'SERVICE_NOT_ENABLED' // BiometricsService is not enabled and cannot be used.
| 'UNKNOWN_REASON'; // An error occurred in the native code that isn’t related to permissions or hardware issues. More information is provided in the BiometricsServiceFailure message.
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |