I am trying to implement notifications in an Expo app using expo-notifications. My trigger object in scheduleNotificationAsync conforms to the YearlyTriggerInput, but it not behaving as expected.
For iOS, I am receiving notifications as if it was indexed at 1. For example for the month of February I see the notification if I set the month to 2. According to the documentation and from looking at the actual source code the month index should start at 0, and if I wanted a notification for February I should set the month to 1.
This is what it says in the documentation:
Note: all properties are specified in JavaScript Date’s ranges.
For Android, I get this error:
[Unhandled promise rejection: Error: Failed to schedule the notification. Trigger of type: calendar is not supported on Android.]
Note: I also get this error on android for WeeklyTriggerInput
This is how I am scheduling my notifications
Notifications.scheduleNotificationAsync({
content: {
title: 'Complete a quiz',
body: "👋 Don't forget solve a quiz today!",
},
trigger: {
hour: 8,
minute: 0,
month: 2,
day: 12
},
})
I am running expo dev builds on physical devices when I see this behaviour. Am I missing something?
Aidan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.