我使用 React Native Firebase 在 React Native 中接收通知。当在后台收到消息并单击通知时,将触发 getInitialNotification。如果我导航到另一个屏幕而不是回到我的 HomeActivity,getInitialNotification 将再次被触发。我怎样才能实现只触发一次?
import React, { Component } from 'react';
import { StyleSheet, Platform, View, Text, YellowBox, Button } from 'react-native';
import StyleIndex from './css/StyleIndex';
import firebase from 'react-native-firebase';
import type { Notification, NotificationOpen } from 'react-native-firebase';
export default class HomeActivity extends Component {
state = { currentUser: null }
componentDidMount() {
const { currentUser } = firebase.auth()
this.setState({ currentUser })
var collectionReference = firebase.firestore().collection('users');
var query = collectionReference.where("phone", "==", currentUser.phoneNumber);
// …Run Code Online (Sandbox Code Playgroud) javascript firebase react-native firebase-cloud-messaging firebase-notifications
我无法直接连接到我的集群服务器。如何在 kubectl 配置文件中设置 HTTP_PROXY?在 Windows 上使用 kubectl。
apiVersion: v1
kind: Config
clusters:
- name: "dev"
cluster:
server: "https://10.100.12.12:9006/k8s/clusters/c-jm5ws"
certificate-authority-data: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJoekNDQ\
VM2Z0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQTdNUnd3R2dZRFZRUUtFeE5rZVc1aGJXbGoKY\
kdsemRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR1Z1WlhJdFkyRXdIa"
Run Code Online (Sandbox Code Playgroud)