506: Review changes.
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
advanceNoticeDaysObservable,
|
||||
} from '../local-storage'
|
||||
import * as PN from 'react-native-push-notification'
|
||||
import { requestNotifications } from 'react-native-permissions'
|
||||
import Moment from 'moment'
|
||||
import { LocalDate } from '@js-joda/core'
|
||||
|
||||
@@ -19,6 +20,11 @@ const PERIOD_REMINDER_ID = '2'
|
||||
const PushNotification = Platform.OS === 'ios' ? PN : PN.default
|
||||
|
||||
export default function setupNotifications(navigate, setDate) {
|
||||
// for Android, this method call is necessary
|
||||
if (Platform.OS === 'android') {
|
||||
requestNotifications()
|
||||
}
|
||||
|
||||
PushNotification.createChannel({
|
||||
channelId: DRIP_CHANNEL_ID, // (required)
|
||||
channelName: 'drip reminder', // (required)
|
||||
@@ -99,7 +105,7 @@ function schedulePeriodNotification() {
|
||||
'YYYY-MM-DD'
|
||||
)
|
||||
|
||||
const advanceNoticeDays = parseInt(advanceNoticeDaysObservable.value, 10)
|
||||
const advanceNoticeDays = parseInt(advanceNoticeDaysObservable.value)
|
||||
|
||||
// ${advanceNoticeDays} days before and at 6 am
|
||||
const reminderDate = predictedBleedingStart
|
||||
|
||||
Reference in New Issue
Block a user