Hello,
I coded my app so that we can have one notification, but I’m wondering how I could code another notification happens 3 seconds later? Could someone provide direction or source code?
// triggers the notification below
<DrawerItem
label="Enable push notifications"
labelStyle= {{
fontFamily: 'AvenirNext-Medium',
fontSize: 12,
paddingTop: 5
}}
onPress={async () => {
await schedulePushNotification();
}}
/>
async function schedulePushNotification() {
await Notifications.scheduleNotificationAsync({
// this one does NOT play
content: {
title: "You've got mail! 📬",
body: 'Here is the notification body',
data: { data: 'goes here' },
},
trigger: { seconds: 2 },
// this one only plays
content: {
title: "Hi! 📬",
body: 'Here is the notification body',
data: { data: 'goes here' },
},
trigger: { seconds: 3 },
});
// this.schedulePushNotification2.bind(this);
}