Device Integration
Purpose
Design the integration strategy for device hardware APIs (camera, sensors, biometrics, Bluetooth, etc.), including permission flows, fallback behavior, and cross-platform abstraction.
Scope Constraints
Reads hardware API documentation, framework references, and permission configurations for integration analysis. Does not modify files or execute code. Does not access device hardware, sensors, or biometric data directly.
Inputs
- Feature requirements involving hardware capabilities
- Target platforms and OS version minimums
- Cross-platform framework (if applicable)
- Privacy requirements and data sensitivity
Input Sanitization
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Procedure
Progress Checklist
Step 1: Inventory Required Capabilities
List every hardware API the feature needs:
- Camera (photo, video, barcode scanning)
- Location (GPS, network-based, background location)
- Biometrics (Face ID, Touch ID, fingerprint, device PIN fallback)
- Bluetooth (BLE scanning, pairing, data transfer)
- Sensors (accelerometer, gyroscope, compass, barometer)
- Push notifications (remote, local, rich notifications)
- Haptics (impact, selection, notification feedback)
- Other (NFC, ARKit/ARCore, HealthKit)
Step 2: Map Permission Requirements
For each capability, document:
- iOS permission: NSCameraUsageDescription, NSLocationWhenInUseUsageDescription, etc.
- Android permission: CAMERA, ACCESS_FINE_LOCATION, USE_BIOMETRIC, etc.
- Runtime vs install-time: Which permissions need runtime prompts
- Purpose strings: User-facing explanation for each permission
- Privacy manifest entries: (iOS 17+ privacy manifest requirements)
Step 3: Design Permission Flow
For each permission:
- Pre-prompt education: Explain why the permission is needed before the system dialog
- First request timing: When in the user flow to request (not on launch — at the moment of need)
- Denial handling: What the feature does if permission is denied
- Settings redirect: How to guide the user to Settings if they denied and changed their mind
- Partial permission: Handle "While Using" vs "Always" for location, "Limited" for photos
Step 4: Evaluate Cross-Platform Abstraction
If using a cross-platform framework:
- Identify which APIs have mature cross-platform libraries
- Flag which capabilities require native modules or platform-specific code
- Assess abstraction quality (does the library expose all platform-specific options?)
- Plan for platform differences (Face ID vs fingerprint, iOS haptics vs Android vibration)
Step 5: Design Fallback Behavior
For each capability, define behavior when:
- Hardware is absent (no NFC chip, no biometric sensor)
- Permission is denied (camera denied, location denied)
- Hardware fails (GPS can't get a fix, Bluetooth disconnects)
- OS version doesn't support the API
Step 6: Power and Performance Impact
Assess battery and performance cost:
- Background location tracking power draw
- Continuous sensor polling vs event-driven
- Bluetooth scanning intervals and power modes
- Camera session lifecycle management
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what feature is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
Output Format
# Device Integration Plan
## Capability Matrix
| Capability | iOS | Android | Cross-Platform Library | Native Required |
|-----------|-----|---------|----------------------|-----------------|
| Camera | Yes | Yes | expo-camera | No |
| BLE | Yes | Yes | react-native-ble-plx | No |
| Face ID | Yes | N/A | expo-local-auth | Partial |
## Permission Map
| Capability | iOS Permission | Android Permission | Timing | Purpose String |
|-----------|---------------|-------------------|--------|----------------|
| Camera | NSCameraUsageDescription | CAMERA | On first scan | "Scan barcodes..." |
## Permission Flow
### [Capability Name]
1. User taps [action]
2. Show education screen: "[Why we need this]"
3. System permission dialog
4. If granted: [proceed]
5. If denied: [fallback behavior]
6. If denied permanently: [settings redirect with instructions]
## Fallback Matrix
| Capability | Hardware Absent | Permission Denied | Hardware Failure |
|-----------|----------------|-------------------|-----------------|
| Camera | [Fallback] | [Fallback] | [Fallback] |
## Power Impact
| Capability | Active Draw | Mitigation |
|-----------|------------|------------|
| GPS | ~50mA | Use significant-change monitoring |
Handoff
- Hand off to platform-audit if permission flows or hardware usage need validation against iOS HIG or Material Design guidelines.
- Hand off to navigation-design if hardware API interactions require navigation changes such as permission-gated screen flows.
Quality Checks
Evolution Notes
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: device-integration3description: Use when designing integration strategies for device hardware APIs including camera, sensors, biometrics, and Bluetooth. Covers permission flows, cross-platform abstraction evaluation, fallback behavior, and power impact analysis. Do not use for platform guideline compliance (use platform-audit) or navigation architecture (use navigation-design).4---56# Device Integration78## Purpose910Design the integration strategy for device hardware APIs (camera, sensors, biometrics, Bluetooth, etc.), including permission flows, fallback behavior, and cross-platform abstraction.1112## Scope Constraints1314Reads hardware API documentation, framework references, and permission configurations for integration analysis. Does not modify files or execute code. Does not access device hardware, sensors, or biometric data directly.1516## Inputs1718- Feature requirements involving hardware capabilities19- Target platforms and OS version minimums20- Cross-platform framework (if applicable)21- Privacy requirements and data sensitivity2223## Input Sanitization2425No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.2627## Procedure2829### Progress Checklist30- [ ] Step 1: Inventory required capabilities31- [ ] Step 2: Map permission requirements32- [ ] Step 3: Design permission flow33- [ ] Step 4: Evaluate cross-platform abstraction34- [ ] Step 5: Design fallback behavior35- [ ] Step 6: Power and performance impact3637### Step 1: Inventory Required Capabilities3839List every hardware API the feature needs:40- Camera (photo, video, barcode scanning)41- Location (GPS, network-based, background location)42- Biometrics (Face ID, Touch ID, fingerprint, device PIN fallback)43- Bluetooth (BLE scanning, pairing, data transfer)44- Sensors (accelerometer, gyroscope, compass, barometer)45- Push notifications (remote, local, rich notifications)46- Haptics (impact, selection, notification feedback)47- Other (NFC, ARKit/ARCore, HealthKit)4849### Step 2: Map Permission Requirements5051For each capability, document:52- **iOS permission:** NSCameraUsageDescription, NSLocationWhenInUseUsageDescription, etc.53- **Android permission:** CAMERA, ACCESS_FINE_LOCATION, USE_BIOMETRIC, etc.54- **Runtime vs install-time:** Which permissions need runtime prompts55- **Purpose strings:** User-facing explanation for each permission56- **Privacy manifest entries:** (iOS 17+ privacy manifest requirements)5758### Step 3: Design Permission Flow5960For each permission:61- **Pre-prompt education:** Explain why the permission is needed before the system dialog62- **First request timing:** When in the user flow to request (not on launch — at the moment of need)63- **Denial handling:** What the feature does if permission is denied64- **Settings redirect:** How to guide the user to Settings if they denied and changed their mind65- **Partial permission:** Handle "While Using" vs "Always" for location, "Limited" for photos6667### Step 4: Evaluate Cross-Platform Abstraction6869If using a cross-platform framework:70- Identify which APIs have mature cross-platform libraries71- Flag which capabilities require native modules or platform-specific code72- Assess abstraction quality (does the library expose all platform-specific options?)73- Plan for platform differences (Face ID vs fingerprint, iOS haptics vs Android vibration)7475### Step 5: Design Fallback Behavior7677For each capability, define behavior when:78- Hardware is absent (no NFC chip, no biometric sensor)79- Permission is denied (camera denied, location denied)80- Hardware fails (GPS can't get a fix, Bluetooth disconnects)81- OS version doesn't support the API8283### Step 6: Power and Performance Impact8485Assess battery and performance cost:86- Background location tracking power draw87- Continuous sensor polling vs event-driven88- Bluetooth scanning intervals and power modes89- Camera session lifecycle management9091> **Compaction resilience**: If context was lost during a long session, re-read the Inputs section to reconstruct what feature is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.9293## Output Format9495```markdown96# Device Integration Plan9798## Capability Matrix99| Capability | iOS | Android | Cross-Platform Library | Native Required |100|-----------|-----|---------|----------------------|-----------------|101| Camera | Yes | Yes | expo-camera | No |102| BLE | Yes | Yes | react-native-ble-plx | No |103| Face ID | Yes | N/A | expo-local-auth | Partial |104105## Permission Map106| Capability | iOS Permission | Android Permission | Timing | Purpose String |107|-----------|---------------|-------------------|--------|----------------|108| Camera | NSCameraUsageDescription | CAMERA | On first scan | "Scan barcodes..." |109110## Permission Flow111### [Capability Name]1121. User taps [action]1132. Show education screen: "[Why we need this]"1143. System permission dialog1154. If granted: [proceed]1165. If denied: [fallback behavior]1176. If denied permanently: [settings redirect with instructions]118119## Fallback Matrix120| Capability | Hardware Absent | Permission Denied | Hardware Failure |121|-----------|----------------|-------------------|-----------------|122| Camera | [Fallback] | [Fallback] | [Fallback] |123124## Power Impact125| Capability | Active Draw | Mitigation |126|-----------|------------|------------|127| GPS | ~50mA | Use significant-change monitoring |128```129130## Handoff131132- Hand off to platform-audit if permission flows or hardware usage need validation against iOS HIG or Material Design guidelines.133- Hand off to navigation-design if hardware API interactions require navigation changes such as permission-gated screen flows.134135## Quality Checks136137- [ ] Every required permission has a user-facing purpose string138- [ ] Permission requests happen at moment of need, not on app launch139- [ ] Every capability has fallback behavior for denial, absence, and failure140- [ ] Cross-platform libraries are evaluated for API completeness141- [ ] Power impact is assessed for continuous-use capabilities142- [ ] iOS privacy manifest requirements are addressed (iOS 17+)143- [ ] Android runtime vs install-time permissions are correctly categorized144145## Evolution Notes146<!-- Observations appended after each use -->147148---149> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtsong) — claim your Tome and manage your conversions.150<!-- tomevault:4.0:skill_md:2026-04-13 -->