Reactjs 无法每3天安排一次世博会通知

Reactjs 无法每3天安排一次世博会通知,reactjs,notifications,expo,native,schedule,Reactjs,Notifications,Expo,Native,Schedule,我正在做一个项目,希望每X天安排一次通知。 以下是我安排通知的部分: let notificationId = await Notifications.scheduleNotificationAsync({ content: { title: title, body: body, data: null, }, trigger: { day: freq, repeats: tru

我正在做一个项目,希望每X天安排一次通知。 以下是我安排通知的部分:

let notificationId = await Notifications.scheduleNotificationAsync({
        content: {
            title: title,
            body: body,
            data: null,
        },
        trigger: { day: freq, repeats: true },   
    }); 
我试过了

        trigger: { hour: freq * 24, repeats: true },   
但每次我遇到这个错误: [未处理的承诺拒绝:错误:未能安排通知。Android不支持类型为:calendar的触发器。]

我知道有些人可能会说,这是因为我在emulator上试用过它,但它仍然可以工作,而且我也在手机上试用过,但它仍然不能工作。

试试这个

const trigger = await Notifications.getNextTriggerDateAsync({
                channelId: DECKS_NOTIFICATION_CHANNEL_ID, 
                hour: 20,
                minute: 0,
                repeats: true,
                //seconds: 2,
            })
然后

SchedulabNotificationTriggers有很多种类型。我给你看的是《每日新闻》。您可以在此链接中查看更多信息

请解释您的代码的功能和工作方式。
let notificationId = await Notifications.scheduleNotificationAsync({
    content: {
        title: title,
        body: body,
        data: null,
    },
    trigger   
});