Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在应用程序关闭时响应本机发送通知_Android_Firebase_React Native_Push Notification - Fatal编程技术网

Android 在应用程序关闭时响应本机发送通知

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

我正在使用firebase和react本机推送通知。我可以在应用程序运行或关闭时从firebase获得通知

我正在尝试发送应用程序发送的本地通知,如提醒

我的包裹

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()。我怎么去呢?谢谢你

只需调用函数或在周期内执行任务。
有人这样做过吗?

有人帮我吗