DEV Community

Discussion on: React Native Local Notifications In Expo

Collapse
 
webuijorgegl profile image
Jorge Suarez

This article needs a little update.

Notifications.scheduleNotificationAsync({
content: {
title: 'title here',
body: 'text here',
data: {
url: screen
//more data here
}
},
trigger: {
repeats: false,
seconds: 10,
channelId: screen
}
});

Do you know the way to trigger a notification on a specific date in the future?

Collapse
 
chakrihacker profile image
Subramanya Chakravarthy

you can do something like this

trigger: {
    seconds: calculateSecondsToSpecifiedDate(date)
}
Enter fullscreen mode Exit fullscreen mode

and calculateSecondsToSpecifiedDate will return seconds

Hope this helps you

Collapse
 
webuijorgegl profile image
Jorge Suarez

Yes... a few days ago I did this. Thank you.