Skip to content

Instantly share code, notes, and snippets.

@ShanikaNishadhi
Created December 27, 2020 17:17
Show Gist options
  • Save ShanikaNishadhi/fbffae04e28cec6e15e6587366517686 to your computer and use it in GitHub Desktop.
Save ShanikaNishadhi/fbffae04e28cec6e15e6587366517686 to your computer and use it in GitHub Desktop.
import PushNotification from 'react-native-push-notification'
const showNotifications = (title, message) => {
PushNotification.localNotification({
title: title,
message: message,
});
};
const handleScheduleNotifications = (title, message) => {
PushNotification.localNotification({
title: title,
message: message,
date: new Date(Date.now() + 5 * 1000),
});
};
const handleCancel = () => {
PushNotification.cancelAllLocalNotifications();
}
export { showNotifications, handleScheduleNotifications , handleCancel };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment