所以我正在尝试实现一个自定义警报应用程序,它可以安排警报,然后在预定的时间运行带有自定义声音的推送通知。
我正在为我的闹钟应用程序使用 React-Native-Push-Notification,一切正常,但在静音模式下,它不播放闹钟声音。
我正在使用 PushNotification.localNotificationSchedule() 安排警报
这里是localNotificationSchedule的代码:
PushNotification.localNotificationSchedule({
channelId: "alarm-channel",
title: alarmNotifData.title,
id: alarmNotifData.id,
message: alarmNotifData.message,
date: alarmNotifData.fire_date,
actions: ["Snooze", "Stop Alarm"],
importance: Importance.HIGH,
playSound: true,
soundName: "default",
allowWhileIdle: true,
invokeApp: false,
});