Closed trinhnguyen81 closed 3 months ago
Do something like this to set a correct time:
const getCorrectDate = () => { const date = new Date(); date.setDate(date.getDate() + 1); date.setHours(23); date.setMinutes(54); return date; };
hi @ajalasegun1 not same that, but it works well on every version os, only without Android 12 and ios 16 :(
@trinhnguyen81 have you found solution?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Bug
Unstable push notifications on Android 12 on Android 9 or 10 it's still okay
Environment info
react-native info
output:Library version: ^8.1.1
Steps To Reproduce
I created a channel like this PushNotification.createChannel( { channelId, // (required) channelName: 'Channel', // (required) importance: Importance.HIGH, // (optional) default: Importance.HIGH. Int value of the Android notification importance vibrate: true, // (optional) default: true. Creates the default vibration pattern if true. playSound: true, soundName: "beeps.mp3" }, (created) => console.log(
createChannel returned '${created}'
) // (optional) callback returns whether the channel was created, false means it already existed. );then create a list schedule push with time different like this const localNotificationSchedule = (id, time, message, sound, playSound = true, vibrate = true) => { const option = { autoCancel: true, largeIcon: 'ic_launcher', vibrate, vibration: 300, playSound, priority: 'high', importance: 'high', soundName: sound, ignoreInForeground: true, userInfo: { id: Number(id) }, message, date: new Date(time) } if (IS_ANDROID) { const channelId = getChannelIdBySound({sound, playSound, vibrate})
} PushNotification.localNotificationSchedule(option) }
Actually: it does not push correct time, it will accumulate and push 1 time, you can check image below![1672917503091](https://user-images.githubusercontent.com/76992888/210797179-ab8b0a81-bb79-4b46-bee0-f01a9c6259cb.JPEG)
Describe what you expected to happen:
I wan to push correct time, pls help me