I am using react-native-push-notifications npm library to implement notifications feature in my app. However, I want to schedule the notifications and I am using PushNotification.localNotificationSchedule for doing so. But somehow it is not working when I am trying to trigger. I have pasted the code below. Someone could please help me with this I am new to this feature.
event Handler
const testPush = () =>{
PushNotification.localNotificationSchedule({
title:'My notification title',
date:new Date(new Date().getTime()+3000),
message:'My notification Message',
allowWhileIdle:false
});
}
Event trigger
<Pressable
onPress={testPush}
style={{ marginTop: 13 }}
>
<View style={{ backgroundColor: '#20232a', padding: 13, alignItems: 'center', borderRadius: 10 }}>
<Text style={{ color: '#ffffff' }}>Test push</Text>
</View>
</Pressable>
