Android 在应用程序关闭时响应本机发送通知
我正在使用firebase和react本机推送通知。我可以在应用程序运行或关闭时从firebase获得通知 我正在尝试发送应用程序发送的本地通知,如提醒 我的包裹Android 在应用程序关闭时响应本机发送通知,android,firebase,react-native,push-notification,Android,Firebase,React Native,Push Notification,我正在使用firebase和react本机推送通知。我可以在应用程序运行或关闭时从firebase获得通知 我正在尝试发送应用程序发送的本地通知,如提醒 我的包裹 import firebase from '@react-native-firebase/app'; import '@react-native-firebase/messaging'; import PushNotification from 'react-native-push-notification'; 发送 PushNot
import firebase from '@react-native-firebase/app';
import '@react-native-firebase/messaging';
import PushNotification from 'react-native-push-notification';
发送
PushNotification.localNotification({
/* Android Only Properties */
channelId: '199720299',
title:'Tilltt',
message: 'YYYYYY',
data: 'dataa',
});
我所做的是安装了后台计时器并在App.js componentdidmount上使用它
BackgroundTimer.setInterval(() => {
// this will be executed every 200 ms
this.showNotification22()
console.log('tic');
//timer will be calculated
}, 24100);
我只需要在应用程序关闭时调用this.showNotification22()。我怎么去呢?谢谢你
只需调用函数或在周期内执行任务。
有人这样做过吗?有人帮我吗