【发布时间】:2019-08-25 00:55:28
【问题描述】:
我正在使用 react-native-push-notification 在我的 react-native 应用程序中显示本地通知。我想每周在上午 10 点重复通知。我编写了以下代码:
import PushNotification from 'react-native-push-notification';
import PushController from './Components/PushController';
export default class App extends Component {
constructor(props) {
super(props);
this.notify.bind(this);
}
notify = () => {
PushNotification.localNotificationSchedule({
message: 'You pushed a notification',
repeatType: 'week',
date: // what should I write here ...???
});
}
}
如何每周显示通知。提前致谢。
【问题讨论】:
-
你可以使用 moment.js 来获取相应的日期。
标签: react-native react-native-push-notification