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