获取警报应用程序以在本机上发送本地推送通知

问题描述 投票:0回答:0

所以我正在尝试实现一个自定义警报应用程序,它可以安排警报,然后在预定的时间运行带有自定义声音的推送通知。

我正在为我的闹钟应用程序使用 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,
        });
android react-native android-developer-api
© www.soinside.com 2019 - 2024. All rights reserved.