You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 lines
2.4 KiB

/**
* Web implementation of the Daily Notification plugin
*
* @author Matthew Raymer
* @version 2.0.0
*/
import { WebPlugin } from '@capacitor/core';
import type { DailyNotificationPlugin, NotificationOptions, NotificationSettings, NotificationResponse, NotificationStatus, BatteryStatus, PowerState, PermissionStatus } from './definitions';
export class DailyNotificationWeb extends WebPlugin implements DailyNotificationPlugin {
async scheduleDailyNotification(_options: NotificationOptions | any): Promise<void> {
// Web implementation placeholder
console.log('Schedule daily notification called on web platform');
}
async getLastNotification(): Promise<NotificationResponse | null> {
return {
id: 'web-notification',
title: 'Web Notification',
body: 'This is a web notification',
timestamp: Date.now()
};
}
async cancelAllNotifications(): Promise<void> {
console.log('Cancel all notifications called on web platform');
}
async getNotificationStatus(): Promise<NotificationStatus> {
return {
lastNotificationTime: Date.now(),
nextNotificationTime: Date.now() + 86400000, // 24 hours
settings: {}
};
}
async updateSettings(_settings: NotificationSettings): Promise<void> {
console.log('Update settings called on web platform');
}
async getBatteryStatus(): Promise<BatteryStatus> {
return {
level: 100,
isCharging: false,
powerState: 1,
isOptimizationExempt: true
};
}
async requestBatteryOptimizationExemption(): Promise<void> {
console.log('Request battery optimization exemption called on web platform');
}
async setAdaptiveScheduling(_options: { enabled: boolean }): Promise<void> {
console.log('Set adaptive scheduling called on web platform');
}
async getPowerState(): Promise<PowerState> {
return {
powerState: 1,
isOptimizationExempt: true
};
}
async checkPermissions(): Promise<PermissionStatus> {
return {
status: 'granted',
granted: true,
notifications: 'granted',
alert: true,
badge: true,
sound: true,
lockScreen: true,
carPlay: false
};
}
async requestPermissions(): Promise<PermissionStatus> {
return {
status: 'granted',
granted: true,
notifications: 'granted',
alert: true,
badge: true,
sound: true,
lockScreen: true,
carPlay: false
};
}
}