refactor(android,ios): rename package com.timesafari to org.timesafari.dailynotification

- Android: move plugin source to org/timesafari/dailynotification, update
  namespace, manifest package, and all package/imports; change intent actions
  to org.timesafari.daily.NOTIFICATION and DISMISS
- iOS: update bundle IDs, BGTask identifiers, subsystem labels, and queue
  names in Plugin and Xcode projects
- Capacitor: update plugin class registration and appIds in configs
- Test apps (android-test-app, daily-notification-test, ios-test-app):
  applicationId/bundleId, manifests, ProGuard, scripts, and docs
- Docs: bulk update references; add CONSUMING_APP_MIGRATION_COM_TO_ORG.md
  for consuming app migration

BREAKING CHANGE: Consuming apps must update plugin class to
org.timesafari.dailynotification.DailyNotificationPlugin, manifest
receivers/actions, and iOS BGTask identifiers per migration doc.
This commit is contained in:
Jose Olarte III
2026-03-12 14:26:07 +08:00
parent b8d9b6247d
commit d8a0eaf413
171 changed files with 749 additions and 646 deletions

View File

@@ -27,7 +27,7 @@ class DailyNotificationBackgroundTaskManager {
// MARK: - Constants
private static let TAG = "DailyNotificationBackgroundTaskManager"
private static let BACKGROUND_TASK_IDENTIFIER = "com.timesafari.dailynotification.prefetch"
private static let BACKGROUND_TASK_IDENTIFIER = "org.timesafari.dailynotification.prefetch"
private static let PREFETCH_TIMEOUT_SECONDS: TimeInterval = 12.0
private static let TASK_EXPIRATION_SECONDS: TimeInterval = 30.0
@@ -55,7 +55,7 @@ class DailyNotificationBackgroundTaskManager {
self.rollingWindow = rollingWindow
// Configure URL session for prefetch requests
let config = URLSessionConfiguration.background(withIdentifier: "com.timesafari.dailynotification.prefetch")
let config = URLSessionConfiguration.background(withIdentifier: "org.timesafari.dailynotification.prefetch")
config.timeoutIntervalForRequest = Self.PREFETCH_TIMEOUT_SECONDS
config.timeoutIntervalForResource = Self.PREFETCH_TIMEOUT_SECONDS
self.urlSession = URLSession(configuration: config)

View File

@@ -31,7 +31,7 @@ import os.log
/// ```xml
/// <key>BGTaskSchedulerPermittedIdentifiers</key>
/// <array>
/// <string>com.timesafari.dailynotification.fetch</string>
/// <string>org.timesafari.dailynotification.fetch</string>
/// </array>
/// ```
///
@@ -42,15 +42,15 @@ class DailyNotificationBackgroundTaskTestHarness {
// MARK: - Constants
static let prefetchTaskIdentifier = "com.timesafari.dailynotification.fetch"
static let prefetchTaskIdentifier = "org.timesafari.dailynotification.fetch"
// MARK: - Structured Logging
/// OSLog categories for structured logging (iOS 13.0+ compatible)
private static let pluginLog = OSLog(subsystem: "com.timesafari.dailynotification", category: "plugin")
private static let fetchLog = OSLog(subsystem: "com.timesafari.dailynotification", category: "fetch")
private static let schedulerLog = OSLog(subsystem: "com.timesafari.dailynotification", category: "scheduler")
private static let storageLog = OSLog(subsystem: "com.timesafari.dailynotification", category: "storage")
private static let pluginLog = OSLog(subsystem: "org.timesafari.dailynotification", category: "plugin")
private static let fetchLog = OSLog(subsystem: "org.timesafari.dailynotification", category: "fetch")
private static let schedulerLog = OSLog(subsystem: "org.timesafari.dailynotification", category: "scheduler")
private static let storageLog = OSLog(subsystem: "org.timesafari.dailynotification", category: "storage")
/// Log telemetry snapshot for validation
static func logTelemetrySnapshot(prefix: String = "DNP-") {
@@ -262,7 +262,7 @@ class DailyNotificationBackgroundTaskTestHarness {
class PrefetchOperation: Operation, @unchecked Sendable {
var isFailed = false
private static let fetchLog = OSLog(subsystem: "com.timesafari.dailynotification", category: "fetch")
private static let fetchLog = OSLog(subsystem: "org.timesafari.dailynotification", category: "fetch")
override func main() {
if isCancelled { return }

View File

@@ -30,8 +30,8 @@ public class DailyNotificationPlugin: CAPPlugin {
// Note: PersistenceController available for Phase 2+ CoreData integration if needed
// Background task identifiers
private let fetchTaskIdentifier = "com.timesafari.dailynotification.fetch"
private let notifyTaskIdentifier = "com.timesafari.dailynotification.notify"
private let fetchTaskIdentifier = "org.timesafari.dailynotification.fetch"
private let notifyTaskIdentifier = "org.timesafari.dailynotification.notify"
// Phase 1: Storage and Scheduler components
var storage: DailyNotificationStorage?
@@ -2150,7 +2150,7 @@ public class DailyNotificationPlugin: CAPPlugin {
// which is required for Capacitor to discover and register the plugin
@objc extension DailyNotificationPlugin: CAPBridgedPlugin {
@objc public var identifier: String {
return "com.timesafari.dailynotification"
return "org.timesafari.dailynotification"
}
@objc public var jsName: String {

View File

@@ -915,8 +915,8 @@ class DailyNotificationReactivationManager {
// Note: BGTaskScheduler doesn't provide a way to query registered task identifiers
// We can only verify by attempting to schedule or by tracking registration ourselves
// For now, we'll return that registration status cannot be verified programmatically
let fetchTaskIdentifier = "com.timesafari.dailynotification.fetch"
let notifyTaskIdentifier = "com.timesafari.dailynotification.notify"
let fetchTaskIdentifier = "org.timesafari.dailynotification.fetch"
let notifyTaskIdentifier = "org.timesafari.dailynotification.notify"
return [
"available": true,

View File

@@ -45,7 +45,7 @@ class DailyNotificationScheduler {
private let notificationCenter: UNUserNotificationCenter
private var scheduledNotifications: Set<String> = []
private let schedulerQueue = DispatchQueue(label: "com.timesafari.dailynotification.scheduler", attributes: .concurrent)
private let schedulerQueue = DispatchQueue(label: "org.timesafari.dailynotification.scheduler", attributes: .concurrent)
// TTL enforcement
private weak var ttlEnforcer: DailyNotificationTTLEnforcer?

View File

@@ -42,7 +42,7 @@ class DailyNotificationStorage {
private let database: DailyNotificationDatabase
private var notificationCache: [String: NotificationContent] = [:]
private var notificationList: [NotificationContent] = []
private let cacheQueue = DispatchQueue(label: "com.timesafari.dailynotification.storage.cache", attributes: .concurrent)
private let cacheQueue = DispatchQueue(label: "org.timesafari.dailynotification.storage.cache", attributes: .concurrent)
// MARK: - Initialization

View File

@@ -5,8 +5,8 @@
<!-- Background Task Identifiers -->
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.timesafari.dailynotification.fetch</string>
<string>com.timesafari.dailynotification.notify</string>
<string>org.timesafari.dailynotification.fetch</string>
<string>org.timesafari.dailynotification.notify</string>
</array>
<!-- Background Modes -->
@@ -52,7 +52,7 @@
<!-- Bundle Identifier -->
<key>CFBundleIdentifier</key>
<string>com.timesafari.dailynotification</string>
<string>org.timesafari.dailynotification</string>
<!-- Version -->
<key>CFBundleShortVersionString</key>