A local notification is created on the phone itself: no server, no token, no Firebase 1 , so it works on the emulator. Reminders, timers and "your download finished" are all local. The trigger decides when it fires:
const { SchedulableTriggerInputTypes: T } = Notifications;
// ...
content: { title: 'Your cart misses you', body: 'Salt and Saffron is still in your cart.',
data: { url: '/cart' } },
trigger: { type: T.TIME_INTERVAL, seconds: 10, channelId: 'new-arrivals' },
// ...
content: { title: 'Reading time', body: 'Twenty pages before work?' },
trigger: { type: T.DAILY, hour: 9, minute: 0 },
// ...
const all = await Notifications.getAllScheduledNotificationsAsync();
all.forEach((n) => console.log(n.content.title, '->', JSON.stringify(n.trigger)));Tapping Every day at 9:00, In 10 seconds and List scheduled in the demo screen logged:
'Reading time', '->', '{"type":"daily","hour":9,"channelId":null,"minute":0}'
'Your cart misses you', '->', '{"seconds":10,"channelId":"new-arrivals","repeats":false,"type":
"timeInterval"}'Ten seconds later "Your cart misses you" appeared. The returned id cancels one notification; cancelAllScheduledNotificationsAsync() cancels all. Other triggers are DATE, WEEKLY, MONTHLY, YEARLY and CALENDAR, plus { channelId } alone for "now". Scheduled notifications survive reboots (RECEIVE_BOOT_COMPLETED, Android Permissions), but a dozing phone may deliver them late.