Skip to content

Instantly share code, notes, and snippets.

@nathantew14
nathantew14 / App.js
Created October 31, 2023 03:04
Minimal reproducible notifications example
import { useState, useEffect, useRef } from 'react';
import { Text, View, Button, Platform } from 'react-native';
import * as Device from 'expo-device';
import * as Notifications from 'expo-notifications';
import Constants from 'expo-constants';
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: false,