gpt4 book ai didi

react-native - 如何在 react-native (ANDROID) 中获取预定的本地通知

转载 作者:行者123 更新时间:2023-12-02 04:24:27 25 4
gpt4 key购买 nike

我正在开发一个 react native 应用程序,我需要在其中安排本地通知,以便用户可以在特定时间接收推送通知。

我已经尝试过 react-native-push-notification 并安排了我所有的本地通知。

我想获取所有预定的本地通知,在 iOS 上我使用了这个PushNotificationIOS.getScheduledLocalNotifications,而在 Android 上我找不到方法。

 PushNotificationIOS.getScheduledLocalNotifications(Localarray => {
console.log("getScheduledLocalNotifications", Localarray);
});

上述ios代码部分获取当前安排在数组中的本地通知。

安卓也有办法吗?

最佳答案

PushNotification.getScheduledLocalNotifications((nots)=>{
console.log(nots);
})

在我的 Android 8.0 设备上为我工作。

确保在调用此函数后创建一些预定通知。

关于react-native - 如何在 react-native (ANDROID) 中获取预定的本地通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56059084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com