docs(ios): update test app docs with recent implementation details

Updated iOS test app documentation to reflect recent implementation work:
channel methods, permission methods, BGTaskScheduler simulator limitation,
and plugin discovery troubleshooting.

Changes:
- Added channel methods (isChannelEnabled, openChannelSettings) to UI mapping
- Fixed permission method name (requestPermissions → requestNotificationPermissions)
- Added checkPermissionStatus to UI mapping
- Added Channel Management section explaining iOS limitations
- Added BGTaskScheduler simulator limitation documentation (Code=1 is expected)
- Added plugin discovery troubleshooting section (CAPBridgedPlugin conformance)
- Added permission and channel methods to behavior classification table
- Updated Known OS Limitations with simulator-specific BGTaskScheduler behavior

Files modified:
- doc/test-app-ios/IOS_TEST_APP_REQUIREMENTS.md: UI mapping, debugging scenarios
- doc/test-app-ios/IOS_PREFETCH_TESTING.md: Known limitations, behavior classification
This commit is contained in:
Matthew
2025-11-16 21:53:56 -08:00
parent 6d25cdd033
commit d7a2dbb9fd
2 changed files with 42 additions and 5 deletions

View File

@@ -301,11 +301,22 @@ When you see `[DNP-FETCH] Fetch success (status=200, bytes=1234, ttl=86400)`, th
**Critical:** These are iOS system limitations, not plugin bugs. If these conditions occur, it is **not a plugin bug**; confirm logs and document behavior.
**BGTaskScheduler Simulator Limitation:**
- **BGTaskSchedulerErrorDomain Code=1 (notPermitted) is EXPECTED on simulator**
- BGTaskScheduler doesn't work reliably on iOS Simulator - this is a known iOS limitation
- Background fetch scheduling will fail on simulator with Code=1 error
- **This is NOT a plugin bug** - notification scheduling still works correctly
- Prefetch won't run on simulator, but will work on real devices with Background App Refresh enabled
- Error handling logs: "Background fetch scheduling failed (expected on simulator)"
- **Testing:** Use Xcode → Debug → Simulate Background Fetch for simulator testing
- **See also:** `doc/directives/0003-iOS-Android-Parity-Directive.md` for implementation details
**iOS may NOT run BGTasks if:**
- App has been force-quit by the user (iOS won't run BGTask for force-quit apps)
- Background App Refresh is disabled in Settings → [Your App]
- Device is in Low Power Mode and idle
- Device battery is critically low
- **On Simulator:** BGTaskScheduler generally doesn't work (Code=1 error is expected)
**iOS timing heuristics:**
- iOS may delay or batch tasks; prefetch might run **much later** than `earliestBeginDate` (up to 15+ minutes)
@@ -432,6 +443,7 @@ When everything is wired correctly, one full cycle should produce:
- Check BGTaskScheduler submission succeeded
- Verify `earliestBeginDate` is at least 1 minute in future
- Check for BGTaskScheduler errors in logs
- **On Simulator:** BGTaskSchedulerErrorDomain Code=1 (notPermitted) is expected - see "Known OS Limitations"
**If you see BGTask scheduled but not persisted:**
- Check database write operations
@@ -522,6 +534,8 @@ Testable matrix of deterministic vs heuristic behavior:
|--------|-------------------|----------------|---------|-------|
| A | `BGTaskScheduler.shared.register` | Yes | Sim + Dev | Registration must always log & succeed/fail deterministically |
| A | `configure()`, `getLastNotification()`, `cancelAllNotifications()`, `getNotificationStatus()`, `updateSettings()` | Yes | Sim + Dev | Logic & I/O-only, no timing dependencies |
| A | `checkPermissionStatus()`, `requestNotificationPermissions()` | Yes | Sim + Dev | Permission state reading and requests, deterministic |
| A | `isChannelEnabled(channelId?)`, `openChannelSettings(channelId?)` | Yes | Sim + Dev | Channel status and settings (iOS: app-wide, not per-channel) |
| A | `getBatteryStatus()`, `getPowerState()`, `getRollingWindowStats()` | Yes | Sim + Dev | State reading, deterministic |
| A | `testJWTGeneration()`, `testEndorserAPI()` | Yes | Sim + Dev | API call logic, deterministic |
| A | Fetch function logic (HTTP calls, DB writes, JSON parsing) | Yes | Sim + Dev | Code path is deterministic |