简体   繁体   中英

Expo calendar Alarm usage

I'm trying to figure out how to use the alarms provided with the Expo Calendar.

Can anyone help me out with this?

Here's the alarm provided by Expo Calendar Expo Alarm

The events are being created fine but I want an alarm to trigger at a given time.

Is this possible?

Here's a reproducible Expo snack Expo Calendar Snack

thanks in advance

The 'alarms' property is an array of Alarm objects This object is defined in Calendar.js:

type Alarm = {
    absoluteDate?: string, //iOS
    relativeOffset?: string,
    structuredLocation?: {
        //iOS
        title?: string,
        proximity?: string, // Proximity
        radius?: number,
        coords?: {
        latitude?: number,
        longitude?: number,
        },
    },
    method?: string, //Method, Android
};

So if you want to set the alarm on a specific date, you could do:

alarms: [ { absoluteDate: "2019-05-05T12:00:00:000Z" } ]

Or if you wanted it to be 15 minutes before:

alarms: [ { relativeOffset: -15 } ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM