diff --git a/lib/notifications.js b/lib/notifications.js index f376784..42ed893 100644 --- a/lib/notifications.js +++ b/lib/notifications.js @@ -4,6 +4,7 @@ import { periodReminderObservable, } 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' @@ -13,6 +14,7 @@ import cycleModule from './cycle' import nothingChanged from '../db/db-unchanged' export default function setupNotifications(navigate, setDate) { + requestNotifications() const PushNotification = Platform.OS === 'ios' ? PN : PN.default PushNotification.createChannel({ diff --git a/package.json b/package.json index e2ba014..eea344e 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "react-native-document-picker": "^8.1.1", "react-native-fs": "^2.20.0", "react-native-modal-datetime-picker": "14.0.0", + "react-native-permissions": "^3.10.0", "react-native-push-notification": "github:bl00dymarie/react-native-push-notification", "react-native-share": "^7.9.0", "react-native-simple-toast": "^1.1.3",