相关疑难解决方法(0)

与Firebase FCM一起使用本机

我正在尝试通过此文档使用React Native和Firebase实现推送通知.

我在本教程中设置了我需要的设置.

   import React, { Component } from 'react'
import { View } from 'react-native'
import { Input, Text, Button } from '../Components'
import type { RemoteMessage } from 'react-native-firebase'
import firebase from 'react-native-firebase'
import type { Notification, NotificationOpen } from 'react-native-firebase';

export default class TestComponent extends Component {

  async componentDidMount() {
    await this.SetUpAuth();
    await this.SetUpMessaging();
    this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen: NotificationOpen) => {
      // Get the action triggered by the notification being opened
      const action = notificationOpen.action;
      // …
Run Code Online (Sandbox Code Playgroud)

javascript firebase react-native firebase-cloud-messaging

7
推荐指数
1
解决办法
5338
查看次数