I have this code to schedule a notification using expo notification
export async function schedulePushNotification( rotina, horas, minutos, dias ) {
const notifId = await Notifications.scheduleNotificationAsync({
content: {
title: "Rotina agendada",
subtitle: "Mensagem de Rotinagem",
body: `Não se esqueça, você definiu ${rotina} as ${horas}:${minutos}`,
vibrate: true | 1000,
priority: AndroidNotificationPriority.HIGH,
// sound: 'default',
},
trigger: {
hour: horas,
minute: minutos,
repeats: true,
},
});
return notifId;
}
Now i have a list with de days, dias = [1, 2, 4, 7]
I want to set a notification in this especific days, the weekday parameter is a number in range from 1 to 7, 1 is sunday, 2 is monday...
I want if possible just one idNotification to this days, but if impossible i want a list of idNotification.
I tried but I couldn't
I've tried to pass a list in the weekDay parameter, but do not accept, and i've tried a list of idNotification, but i receive a dictionary with random letters
Each weekday should be scheduled separately.
Schedule Weekday List:
Refactored Version:
More General Solution: