admin管理员组文章数量:1126366
I'm working on Adhan (prayer) react native app where i need to integrate 5 times prayer alarms. I'm using @notifee/react-native library for schedule local notifications for alarm. I'm facing two issues.
Issues
First, When i tries to update already scheduled notification sound, it didn't update with new file name. my sound files located in raw/ folder. Strange thing is when i list scheduled notifications it shows that sound is updated but when notification appears, It plays the sound that was set the first time it was configured. I check documentation it says that sound setting cannot be overridden once the channel is created, so i try deleting channel re-create ever time when notification re-scheduling but no change issue still the same. see my scheduleAlarmNotification function;
Second, Notification arrive late with not just seconds late but minutes late delay is different every time i tested with 12 & 26 minutes delay on real device. Notification shows exact time in message but arrive late.
Code
import notifee, {
AndroidImportance,
TimestampTrigger,
TriggerType,
} from '@notifee/react-native';
import moment from 'moment';
export async function scheduleAlarmNotification(
id: string,
title = 'Alarm',
timestamp: any,
sound = 'adhan_short',
enabled = true,
) {
let channelId;
await notifee
.deleteChannel(`sound`) //${id}_channel
.then(async res => {
console.log('
本文标签:
androidScheduled notification sound not updating and appears lateStack Overflow
版权声明:本文标题:android - Scheduled notification sound not updating and appears late - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1736685028a1947616.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论