Open yfng96 opened 2 years ago
"@react-native-community/push-notification-ios": "^1.8.0",
Hi, I am trying to create a timer feature using local notifications. The code below works well with no duplicate notification in Notification Center.
BackgroundTimer.runBackgroundTimer(() => { setSecs((prevVal) => { Platform.OS === 'ios' ? PushNotificationIOS.addNotificationRequest({ id: '21474', title, body: moment() .startOf('day') .seconds(prevVal + 1) .format('H:mm:ss'), badge: 0, }) : PushNotification.localNotification({ id: 21474, tag: title, ticker: 'My Notification Ticker', // (optional) channelId: '123', // (required) channelName: 'Default Notification', // (required) largeIcon: '', smallIcon: '', color: Colors.digital, title, message: moment() .startOf('day') .seconds(prevVal + 1) .format('H:mm:ss'), showWhen: true, when: Date.now(), allowWhileIdle: true, ongoing: true, onlyAlertOnce: true, }); return prevVal + 1; }); }, 1000);
However, the popups keep appearing. Is there any way to show the popup only once?
I have the same problem, using background-timer. Already managed to solve?
"@react-native-community/push-notification-ios": "^1.8.0",
Hi, I am trying to create a timer feature using local notifications. The code below works well with no duplicate notification in Notification Center.
However, the popups keep appearing. Is there any way to show the popup only once?![output-onlinegiftools-2](https://user-images.githubusercontent.com/48579830/129935030-a27ad55e-3772-4c9c-bcf5-b43911e5b7a3.gif)