feat(ios): implement Phase 1 permission methods and fix build issues

Implement checkPermissionStatus() and requestNotificationPermissions()
methods for iOS plugin, matching Android functionality. Fix compilation
errors across plugin files and add comprehensive build/test infrastructure.

Key Changes:
- Add checkPermissionStatus() and requestNotificationPermissions() methods
- Fix 13+ categories of Swift compilation errors (type conversions, logger
  API, access control, async/await, etc.)
- Create DailyNotificationScheduler, DailyNotificationStorage,
  DailyNotificationStateActor, and DailyNotificationErrorCodes components
- Fix CoreData initialization to handle missing model gracefully for Phase 1
- Add iOS test app build script with simulator auto-detection
- Update directive with lessons learned from build and permission work

Build Status:  BUILD SUCCEEDED
Test App:  Ready for iOS Simulator testing

Files Modified:
- doc/directives/0003-iOS-Android-Parity-Directive.md (lessons learned)
- ios/Plugin/DailyNotificationPlugin.swift (Phase 1 methods)
- ios/Plugin/DailyNotificationModel.swift (CoreData fix)
- 11+ other plugin files (compilation fixes)

Files Added:
- ios/Plugin/DailyNotificationScheduler.swift
- ios/Plugin/DailyNotificationStorage.swift
- ios/Plugin/DailyNotificationStateActor.swift
- ios/Plugin/DailyNotificationErrorCodes.swift
- scripts/build-ios-test-app.sh
- scripts/setup-ios-test-app.sh
- test-apps/ios-test-app/ (full test app)
- Multiple Phase 1 documentation files
This commit is contained in:
Server
2025-11-13 05:14:24 -08:00
parent 2d84ae29ba
commit 5844b92e18
61 changed files with 9676 additions and 356 deletions

View File

@@ -292,11 +292,18 @@ class DailyNotificationBackgroundTaskManager {
// Parse new content
let newContent = try JSONSerialization.jsonObject(with: data) as? [String: Any]
// Update notification with new content
var updatedNotification = notification
updatedNotification.payload = newContent
updatedNotification.fetchedAt = Date().timeIntervalSince1970 * 1000
updatedNotification.etag = response.allHeaderFields["ETag"] as? String
// Create updated notification with new content
let currentTime = Int64(Date().timeIntervalSince1970 * 1000)
let updatedNotification = NotificationContent(
id: notification.id,
title: notification.title,
body: notification.body,
scheduledTime: notification.scheduledTime,
fetchedAt: currentTime,
url: notification.url,
payload: newContent,
etag: response.allHeaderFields["ETag"] as? String
)
// Check TTL before storing
if ttlEnforcer.validateBeforeArming(updatedNotification) {
@@ -335,8 +342,16 @@ class DailyNotificationBackgroundTaskManager {
// Update ETag if provided
if let etag = response.allHeaderFields["ETag"] as? String {
var updatedNotification = notification
updatedNotification.etag = etag
let updatedNotification = NotificationContent(
id: notification.id,
title: notification.title,
body: notification.body,
scheduledTime: notification.scheduledTime,
fetchedAt: notification.fetchedAt,
url: notification.url,
payload: notification.payload,
etag: etag
)
storeUpdatedContent(updatedNotification) { success in
completion(success)
}