|
|
@@ -5,7 +5,7 @@ import trackTimeService, { machine } from "@/store/trackTimeMachine"
|
|
|
import Taro from "@tarojs/taro";
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
-let PushNotification, Importance,NativeModules;
|
|
|
+let PushNotification, Importance, NativeModules;
|
|
|
if (process.env.TARO_ENV == 'rn') {
|
|
|
PushNotification = require('react-native-push-notification')
|
|
|
Importance = require('react-native-push-notification').Importance
|
|
|
@@ -156,19 +156,21 @@ export const getLocalPush = () => {
|
|
|
else if (item.mode == 'RECURRING') {
|
|
|
const { time, repeat_type } = item.recurring;
|
|
|
const date = dayjs().format('YYYY-MM-DD')
|
|
|
- PushNotification.localNotificationSchedule({
|
|
|
- //... You can use all the options from localNotifications
|
|
|
- channelId: item.id,
|
|
|
- title: item.title,
|
|
|
- message: item.content + ' ', // (required)
|
|
|
- date: new Date(date + 'T' + time), // in 60 secs
|
|
|
- allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
- messageId: item.id,
|
|
|
- repeatType: repeat_type,
|
|
|
- // repeatType:'minute',
|
|
|
- /* Android Only Properties */
|
|
|
-
|
|
|
- })
|
|
|
+ var Jto = require('react-native').NativeModules.NativeBridge;
|
|
|
+ Jto.addLocalPush(item.title,item.content,time)
|
|
|
+ // PushNotification.localNotificationSchedule({
|
|
|
+ // //... You can use all the options from localNotifications
|
|
|
+ // channelId: item.id,
|
|
|
+ // title: item.title,
|
|
|
+ // message: item.content + ' ', // (required)
|
|
|
+ // date: new Date(date + 'T' + time), // in 60 secs
|
|
|
+ // allowWhileIdle: true, // (optional) set notification to work while on doze, default: false
|
|
|
+ // messageId: item.id,
|
|
|
+ // repeatType: repeat_type,
|
|
|
+ // // repeatType:'minute',
|
|
|
+ // /* Android Only Properties */
|
|
|
+
|
|
|
+ // })
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
@@ -198,9 +200,9 @@ export const getLocalPush = () => {
|
|
|
else if (item.mode == 'RECURRING') {
|
|
|
const { time, repeat_type } = item.recurring;
|
|
|
const date = dayjs().format('YYYY-MM-DD')
|
|
|
- const {HolaModule} = NativeModules
|
|
|
+ const { HolaModule } = NativeModules
|
|
|
debugger
|
|
|
- HolaModule.addLocalPush(item.title, item.content,time)
|
|
|
+ HolaModule.addLocalPush(item.title, item.content, time)
|
|
|
return;
|
|
|
|
|
|
PushNotification.localNotificationSchedule({
|