PushNotification Repeat🔁 doesn't work on both Android and IOS platforms. I don't have any ideas to fix it. I added my code to check and let me know if someone has an idea.
Environment info
react-native info output:
OS: macOS 11.6
CPU: (8) arm64 Apple M1
Memory: 123.45 MB / 8.00 GB
Shell: 3.3.1 - /opt/homebrew/bin/fish
Binaries:
Node: 16.10.0 - /opt/homebrew/bin/node
Yarn: 1.22.15 - /opt/homebrew/bin/yarn
npm: 7.24.0 - /opt/homebrew/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: ^0.64.0 => 0.64.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
pushNotifHelper.scheduleNotif(
time,
name,
notifBody,
notif_id,
extraData,
hasRepeat,
repeatComponent,
);
/*
👇
hasRepeat: true
name: "PushNotification Title"
notifBody: "Here’s your friendly reminder for \"PushNotification Title\", Tap here to continue."
notif_id: 319621152
extraData: {}
repeatComponent: {id: 2, name: 'Every day', type: 'day', interval: 1}
time: Sun Jun 12 2022 21:05:22 GMT+0430 (Iran Daylight Time) {}
*/
Description:
We are using react-native-push-notification package to handle push notifications on Android and using @react-native-community/push-notification-ios to handle push notifications on IOS devices.
We have a Reminder feature to remind people to do their tasks. we want to be able to set a PushNotification with these types: Every day, Every week, Every month for IOS and these types: Every day, Every two days, Every three days, Every week, Every two weeks, Every month for Android devices.
Unfortunately, the repetitive push notification doesn't work perfectly on both OS. When I change these configs to set a PushNotification for every minute, it works fine but when I set a PushNotification for every day, it occurs once on the first day. On other days nothing happened.
I don't know, what should i do. I think the ReactNative app bundle kills after a day and these notifications disappear forever. Someone suggested using react-native-fetch-background package to reschedule the ReactNative app bundle but I don't know is this the right way or not?.
Bug
PushNotification Repeat🔁 doesn't work on both Android and IOS platforms. I don't have any ideas to fix it. I added my code to check and let me know if someone has an idea.
Environment info
react-native info
output:"react-native-push-notification": "^8.1.1", "@react-native-community/push-notification-ios": "^1.10.1",
Steps To Reproduce
every day
at 6 p.m.Describe what you expected to happen:
I expected when I set a new repetitive PushNotification for every day, it occurs at firedate/date every day.
Reproducible sample code
PushNotif Helper file:
Set PushNotification file:
Description:
We are using
react-native-push-notification
package to handle push notifications on Android and using@react-native-community/push-notification-ios
to handle push notifications on IOS devices.We have a Reminder feature to remind people to do their tasks. we want to be able to set a PushNotification with these types: Every day, Every week, Every month for IOS and these types: Every day, Every two days, Every three days, Every week, Every two weeks, Every month for Android devices.
Unfortunately, the repetitive push notification doesn't work perfectly on both OS. When I change these configs to set a PushNotification for every minute, it works fine but when I set a PushNotification for
every day
, it occurs once on the first day. On other days nothing happened.I don't know, what should i do. I think the ReactNative app bundle kills after a day and these notifications disappear forever. Someone suggested using
react-native-fetch-background
package to reschedule the ReactNative app bundle but I don't know is this the right way or not?.Thanks in advance for your helps ✌️