尝试用react native编写一个app 需要实现定时提醒 不知道该怎么实现
你是想要应用在后台的时候也能触发提醒吗?前端提醒用setTimeout/setInterval完成就行了。
应用在后台的提醒属于推送功能。
iOS版本推送功能的文档:http://react-native.cn/docs/pushnotificationios.html#content
Android版本实现推送需要接入第三方插件,例如极光推送、个推、mipush等等,需要参照文档进行接入后,参考http://react-native.cn/docs/native-modules-android.html#content给js导出接口。
var TimerMixin = require('react-timer-mixin');
module.exports = React.createClass({
mixins: [TimerMixin],
handdle: function() {
this.setTimeout(() => {
}, 2000);
}
});