export class MyNotificationDelegate implements UNUserNotificationCenterDelegate {
/**
* Constructor for MyNotificationDelegate class.
* Initializes the delegate and logs a message for debugging.
*/
constructor() {
// 在这里可以做一些初始化工作
console.log("MyNotificationDelegate 实例已创建");
}
/**
* This method is called when a notification arrives while the app is running in the foreground.
* It ensures that alerts, sounds, and badges are still shown.
*/
userNotificationCenter(
notification: UserNotifications.UNNotification ): void {
// 打印收到的通知内容,方便调试
console.log("接收到通知,内容:", notification);
console.log("abcd");
}
}
2***@qq.com
- 发布:2024-10-17 11:17
- 更新:2024-10-18 12:00
- 阅读:311
2***@qq.com (作者)
我已经搞定啦
2024-10-25 13:36