Skip to content

microsoft/power-platform-skills / plugins/mobile-apps/skills/add-native

add-native

Unverified

Public entry point for native device capabilities and native controls — camera, image picker, barcode/QR scanner, document picker, file picker, secure storage, file system, sharing, haptic feedback, PDF generation/viewing, pen/signature capture, background GPS/geolocation tracking, or supported local file workflows — in a Power Apps mobile app. Also owns routing to internal camera/PDF/pen/geolocation implementation helpers and the guidance boundary between native wrappers and Dataverse File/Image host controls.

FileKindSize
SKILL.mdskill md37.0 KB
references/native-controls.mdmarkdown4.8 KB

references/native-controls.md

View on GitHub
# Native controls in a verified release

Read the [release lifecycle](../../../shared/references/mobile-release-lifecycle.md)
first. Resolve the existing app, not the newest plugin template:

```bash
node "${PLUGIN_ROOT}/scripts/resolve-mobile-release.js" --project-root '<working_dir>' --local-development
```

Local-development results follow the shared lifecycle policy. A package manifest,
successful import, or successful TypeScript check does not prove that a player
or wrapped base contains matching native code. Do not install the aggregate to
fix older binaries. Upgrade only through a separately approved, exact verified
release migration.

## Public imports are release-conditional

Use these import-selection rules before generating any wrapper:

- **Strict context:** require the exact installed aggregate or legacy leaf in
  the published inventory.
- **Local context** (`validationScope: "local-development-only"`): select from
  installed packages using their exact versions, public exports, docs and types;
  no published inventory is required. Prefer aggregate subpaths when installed
  and exposing the requested API; otherwise use the matching installed legacy
  leaf. Keep Player/base compatibility unverified.

`@microsoft/power-apps-native-controls` at the root is metadata, not a runtime
barrel. When the applicable branch selects the aggregate, use these subpaths:

| Capability | Public subpath | Runtime exports |
|---|---|---|
| PDF viewer | `@microsoft/power-apps-native-controls/pdf` | `NativePdfViewer` |
| Pen/signature | `@microsoft/power-apps-native-controls/pen` | `PenInputNative`, `PenInputStatus`, `PenInputErrorCode` |
| Geolocation | `@microsoft/power-apps-native-controls/geolocation` | `BgLocationClient`, `geoService`, `AuthMethod`, `ConnectionType` |

There is no barcode subpath. Barcode/QR scanning stays with the resolved
release's `expo-camera` wrapper.

Controls **0.2.0** corresponds to PDF **0.2.9**, pen **0.1.9**, background
location **0.2.3**, and extension SDK **0.4.2**, with an **Expo 55 /
React Native 0.83.6** baseline. These are package facts, not a claim that a
verified player/base is available, and not evidence of Expo 57 compatibility.
Read the installed public README, exports, and types for the selected version;
do not infer newer method signatures or copy a different library's examples.

Legacy leaf imports follow the same strict/local rules for the matching version:

- `@microsoft/power-apps-native-pdf-viewer`
- `@microsoft/power-apps-native-pen-input`
- `@microsoft/power-apps-native-bglocation`

Choose one literal module specifier at generation time. Do not emit a dynamic
package-name import, import both paths, or try the aggregate and fall back to a
leaf at runtime. Metro must resolve imports even when an execution branch is
not taken. Native wrappers must guard `Platform.OS` for `ios` / `android`
**before** lazy `import(...)` inside `try`/`catch`. Return explicit unsupported
or failure results; no fake native implementation.

## Native configuration is host/base owned

`enableNativeControls` is host-owned plugin registration, not a consumer
workaround. Use it only on a **verified host release** that supports it, and
only as part of that release's migration. Published host **0.4.0 lacks it**.
Never inject it into an older host or copy native config into an app.

Keep these separate:

1. Package inclusion in JS and the native binary.
2. OS declarations built into the base.
3. Runtime permission grants on the device.
4. Whether the app actually invokes a capability.

Removing controls dependencies, disabling controls, or not calling them does
**not** remove unused default Android permissions. The customer uses a fixed
capability base. Different declarations need another verified base; optional
per-customer permission wrapping is deferred. Missing declarations cannot be
repaired by a runtime permission request.

## Location modes and ownership

A one-shot read uses `new BgLocationClient().getCurrentLocation()` and requires
no `app_id`, data source, target table, or `startTracking`. It still requires a
matching native binary and the appropriate device location grant.

Continuous tracking is a separate workflow. For background-location **0.2.3**,
`startTracking` requests background permissions even with
`trackInBackground: false`; do not advertise a foreground-only permission mode.
Tracking is shared: `stopTracking()` and `isTracking()` have no `app_id`
parameter. Coordinate a single owner across screens/consumers; never stop a
session merely because an unrelated screen unmounts. Do not promise per-app
isolation.

Read that installed version's full `geoService(dataSource, app_id)` contract,
permission behavior, persistence options, and MSAL/Dataverse mapping before
implementing tracking. Do not substitute `configureSync`, `HttpSyncContract`,
or APIs from the unrelated `powerapps-geolocation-control` library.
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall