ios - 如何在我的推送通知上映射一个元素?
问题描述
我使用了 React-native Push Notification,我想在我的 .map 上获取我的元素来个性化我的通知。当我使用静态字符串时一切正常。但是当我添加我的 .map 时,没有任何效果。
我的功能
renderNotif = () => {
return this.state.sport.clubs.map((element) => {
return (
PushNotification.localNotificationSchedule({
message: element.adversaire, // (required)
date: new Date(Date.now() + 10 * 1000), // in 60 secs
}))
})
}
我的功能也在我的 componentDidmount 上
解决方案
推荐阅读
- python - 以全屏模式显示单个图像(如 powerpoint)
- flutter - 在 Dart 中导入整个文件和只导入带有 show 的类有什么区别?
- javascript - 如何使用 Directus Javascript SDK 进行条件过滤?
- android - 查找用户是否在锁定屏幕上禁用通知
- python - 如何将更新的DataFrame实时输入sql或db
- .net - 同时调用 Multi-WebApi 导致在前一个操作完成之前在此上下文上启动了第二个操作
- c++ - 标题中的模板规范问题
- r - 使用 cmd 和 R 配置数据块
- gridview - Visual FoxPro:删除网格中的行
- javascript - 如何在节点中删除表单后重新加载页面