Merge branch '537-bug-temperature-reminder-on-ios' into 'master'
Fix: Target reminder with correct id Closes #537 See merge request bloodyhealth/drip!389
This commit is contained in:
@@ -9,7 +9,8 @@ import nothingChanged from '../db/db-unchanged'
|
|||||||
export default function setupNotifications(navigate) {
|
export default function setupNotifications(navigate) {
|
||||||
Notification.configure({
|
Notification.configure({
|
||||||
onNotification: (notification) => {
|
onNotification: (notification) => {
|
||||||
if (notification.id === '1') {
|
// https://github.com/zo0r/react-native-push-notification/issues/966#issuecomment-479069106
|
||||||
|
if (notification.data?.id === '1' || notification.id === '1') {
|
||||||
navigate('TemperatureEditView')
|
navigate('TemperatureEditView')
|
||||||
} else {
|
} else {
|
||||||
navigate('Home')
|
navigate('Home')
|
||||||
@@ -32,6 +33,7 @@ export default function setupNotifications(navigate) {
|
|||||||
|
|
||||||
Notification.localNotificationSchedule({
|
Notification.localNotificationSchedule({
|
||||||
id: '1',
|
id: '1',
|
||||||
|
userInfo: { id: '1' },
|
||||||
message: labels.tempReminder.notification,
|
message: labels.tempReminder.notification,
|
||||||
date: target.toDate(),
|
date: target.toDate(),
|
||||||
vibrate: false,
|
vibrate: false,
|
||||||
@@ -71,6 +73,7 @@ function setupPeriodReminder() {
|
|||||||
|
|
||||||
Notification.localNotificationSchedule({
|
Notification.localNotificationSchedule({
|
||||||
id: '2',
|
id: '2',
|
||||||
|
userInfo: { id: '2' },
|
||||||
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
message: labels.periodReminder.notification(daysToEndOfPrediction),
|
||||||
date: reminderDate.toDate(),
|
date: reminderDate.toDate(),
|
||||||
vibrate: false
|
vibrate: false
|
||||||
|
|||||||
Reference in New Issue
Block a user