|
|
@ -20,13 +20,13 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
private scheduledNotifications: Set<string> = new Set(); |
|
|
|
private activeDid?: string; |
|
|
|
|
|
|
|
async configure(_options: any): Promise<void> { |
|
|
|
async configure(_options: Record<string, unknown>): Promise<void> { |
|
|
|
// Web implementation placeholder
|
|
|
|
console.log('Configure called on web platform'); |
|
|
|
// Configuration applied for web platform
|
|
|
|
} |
|
|
|
|
|
|
|
async maintainRollingWindow(): Promise<void> { |
|
|
|
console.log('Maintain rolling window called on web platform'); |
|
|
|
// Rolling window maintenance for web platform
|
|
|
|
} |
|
|
|
|
|
|
|
async getRollingWindowStats(): Promise<{ |
|
|
@ -34,7 +34,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
maintenanceNeeded: boolean; |
|
|
|
timeUntilNextMaintenance: number; |
|
|
|
}> { |
|
|
|
console.log('Get rolling window stats called on web platform'); |
|
|
|
// Get rolling window stats for web platform
|
|
|
|
return { |
|
|
|
stats: 'Web platform - rolling window not applicable', |
|
|
|
maintenanceNeeded: false, |
|
|
@ -48,7 +48,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
canSchedule: boolean; |
|
|
|
fallbackWindow: string; |
|
|
|
}> { |
|
|
|
console.log('Get exact alarm status called on web platform'); |
|
|
|
// Get exact alarm status for web platform
|
|
|
|
return { |
|
|
|
supported: false, |
|
|
|
enabled: false, |
|
|
@ -247,7 +247,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
/** |
|
|
|
* Schedule content fetch (web implementation) |
|
|
|
*/ |
|
|
|
async scheduleContentFetch(config: any): Promise<void> { |
|
|
|
async scheduleContentFetch(config: Record<string, unknown>): Promise<void> { |
|
|
|
console.log('Content fetch scheduled (web mock):', config); |
|
|
|
// Mock implementation - in real app would use Service Worker
|
|
|
|
} |
|
|
@ -255,7 +255,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
/** |
|
|
|
* Schedule user notification (web implementation) |
|
|
|
*/ |
|
|
|
async scheduleUserNotification(config: any): Promise<void> { |
|
|
|
async scheduleUserNotification(config: Record<string, unknown>): Promise<void> { |
|
|
|
console.log('User notification scheduled (web mock):', config); |
|
|
|
// Mock implementation - in real app would use browser notifications
|
|
|
|
} |
|
|
@ -263,7 +263,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
/** |
|
|
|
* Schedule dual notification (web implementation) |
|
|
|
*/ |
|
|
|
async scheduleDualNotification(config: any): Promise<void> { |
|
|
|
async scheduleDualNotification(config: Record<string, unknown>): Promise<void> { |
|
|
|
console.log('Dual notification scheduled (web mock):', config); |
|
|
|
// Mock implementation combining content fetch and user notification
|
|
|
|
} |
|
|
@ -381,7 +381,10 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
} |
|
|
|
|
|
|
|
// Calculate next notification time
|
|
|
|
const nextTime = this.calculateNextNotificationTime(options.time!); |
|
|
|
if (!options.time) { |
|
|
|
throw new Error('Time parameter is required for scheduling'); |
|
|
|
} |
|
|
|
const nextTime = this.calculateNextNotificationTime(options.time); |
|
|
|
const delay = nextTime.getTime() - Date.now(); |
|
|
|
|
|
|
|
if (delay > 0) { |
|
|
@ -411,7 +414,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin { |
|
|
|
}); |
|
|
|
|
|
|
|
// Handle notification click
|
|
|
|
browserNotification.onclick = () => { |
|
|
|
browserNotification.onclick = (): void => { |
|
|
|
if (notification.url) { |
|
|
|
window.open(notification.url, '_blank'); |
|
|
|
} |
|
|
|