标签: react-native-firebase

在检索发件人 ID 的 FCM 令牌之前未设置 APNS 设备令牌 - React Native Firebase

我一直在按照教程使用react-native-firebase版本5.2.0在我的react-native应用程序上设置远程推送通知。配置完所有内容并运行应用程序后,出现错误:

在检索发件人 ID '' 的 FCM 令牌之前未设置 APNS 设备令牌。对此 FCM 令牌的通知将不会通过 APNS 传递。设置 APNS 令牌后,请务必重新检索 FCM 令牌。

一直试图找出解决这个问题的方法,但不太成功。在react-native上运行:0.61.2,react-native-firebase:5.2.0

以下是我的 AppDelegate.m

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <RNCPushNotificationIOS.h>
#import <UserNotifications/UserNotifications.h>
#import <Firebase.h>

@import Firebase;
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"helloworld"
                                            initialProperties:nil];

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = …
Run Code Online (Sandbox Code Playgroud)

ios firebase react-native react-native-firebase

56
推荐指数
9
解决办法
9万
查看次数

获取错误:Firestore:调用方没有执行指定操作的权限。但是我已经登录了

我有这个问题并尝试使用我找到的所有解决方案进行修复,但仍然无效。我在 firebase cloud firestore 中的规则是:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write : if auth != null ;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

而且我已经启用了匿名登录方法。

安卓

android/build.gradle
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'
Run Code Online (Sandbox Code Playgroud) android/app/build.gradle
    compile project(':react-native-firebase')
    compile project(':react-native-fbsdk')
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.4'
    implementation 'com.google.firebase:firebase-firestore:17.1.0'
Run Code Online (Sandbox Code Playgroud) Testing.js
firebase.auth().signInAnonymously().then(()=>{
        firebase.app().firestore().collection('Hello').doc('hello').set({
          id:'fadsa'
        }).catch((err)=>{
          alert(err);
        })
      })
Run Code Online (Sandbox Code Playgroud)

react-native react-native-firebase

20
推荐指数
4
解决办法
2万
查看次数

错误:在iOS上本地未找到RNFirebase核心模块

我创建了一个新的应用程序,我正在尝试使用react-native-firebase.但我不断得到这个错误:

在iOS上本地未找到RNFirebase核心模块,确保您已在项目的"Podfile"中正确包含RNFirebase pod并运行"pod install".

有关ios设置指南,请参见http://invertase.link/ios.

我已经完成的步骤:

  1. yarn add react-native-firebase

  2. react-native link react-native-firebase

  3. 在.../myproject/ios/myproject下设置我的.plist文件
  4. pod update确保我使用Ruby 2.5.0后跑了
  5. Ran pod安装

我目前使用的pod文件是:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'MyProject' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!
    pod 'Firebase/Core'
    pod 'Firebase/Database'
    pod 'Firebase/Messaging'

  target 'MyProjectTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
Run Code Online (Sandbox Code Playgroud)

这些是我正在使用的版本:

"react": …
Run Code Online (Sandbox Code Playgroud)

cocoapods react-native react-native-firebase

19
推荐指数
1
解决办法
5887
查看次数

Firebase 和 iOS 14 &gt; 动态链接跟踪和活动是否会继续有效?

As most of you are probably aware of, iOS 14 will basically put an end to app acquisition tracking as we know it.

Here are two great articles that explore the issue in length:

Putting aside the critical changes most people will have to make to their business models, my question has to do with Firebase's dynamic …

ios firebase react-native firebase-dynamic-links react-native-firebase

16
推荐指数
1
解决办法
2930
查看次数

我们如何将Firebase Analytics与基于expo的react-native应用程序结合使用

我正在尝试将Firebase Analytics(FA)添加到我的react-native应用程序中.

实际上,我发现谷歌分析(GA)使用这个库没有问题expo-analytics.

但显然Firebase分析功能更强大,而且它真的是为移动应用而构建的.这就是为什么我想在我的应用程序中使用它,但问题是:

我正在使用Expo,我无法分离我的应用程序来添加json配置文件.

所以我的问题是:有没有办法让Firebase Analytics与Expo和本地反应无需分离?

google-analytics firebase react-native firebase-analytics react-native-firebase

15
推荐指数
1
解决办法
4333
查看次数

找不到-lRCTGeolocation的库

已经安装了react-native-firebase&,我正在使用我的project.xcworkspace在iOS上使用Xcode进行构建,这在我只安装auth和core软件包时很好。当我安装消息传递软件包时,无论如何我都会得到错误“找不到-lRCTGeolocation的库”。有些可以帮助我吗?

react-native:0.60.3 react-native-firebase:5.5.4

提前感谢。

我从pod文件中删除了消息传递参考,删除了pods文件夹和podfile.lock文件,重新安装了pods,清理了构建但没有解决。

xcode pod ios react-native react-native-firebase

14
推荐指数
1
解决办法
4242
查看次数

错误:找不到参数的方法平台() - React Native - Firebase

有没有人按照官方文档遇到过这个问题react-native-firebase

ERROR: Could not find method platform() for arguments [com.google.firebase:firebase-bom:21.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Open File
Run Code Online (Sandbox Code Playgroud)

这是在编辑这两个build.gradle文件并单击syncAndroid Studio 弹出窗口后发生的。我认为这是因为 gradle 问题。

欢迎任何帮助。虽然找不到类似的问题。

build.gradle根据 Gabriele Mariotti 的要求编辑了两个文件的问题。

这是build.gradle文件内容。

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 23
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            url …
Run Code Online (Sandbox Code Playgroud)

android gradle firebase react-native react-native-firebase

14
推荐指数
2
解决办法
1万
查看次数

无法访问 Cloud Firestore 后端 - React Native Firebase v9

我在 SO 上看到了很多关于这个问题的问题,但没有一个得到解答(或者解决方案不起作用),我不知道为什么。人们不断遇到这个错误,但没有提供解决方案。从过去的几天来看,即使我遇到了这个错误(注意:它似乎在我的物理设备上工作正常(不是在调试时,它只有在我释放它时才工作),但在 android 模拟器上却不起作用,所以我很确定我的互联网工作正常):

Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.
(Saw setTimeout with duration 3052257ms)
Authorization status: 1

[2022-02-09T07:05:26.500Z]  @firebase/firestore: Firestore (9.6.5): Could not reach Cloud Firestore backend. Backend 
didn't respond within 10 seconds.
This typically indicates that …
Run Code Online (Sandbox Code Playgroud)

javascript firebase react-native google-cloud-firestore react-native-firebase

14
推荐指数
1
解决办法
2万
查看次数

React Native Firebase错误线程1 SIGABRT - iOS

问题

在遵循react-native-firebase教程后,我的应用程序在成功构建后挂起.我在Xcode中遇到的错误是:Thread 1: signal SIGABRT.我从其他问题中了解到这与连接有关,但我不知道为什么会出现这种错误.

这是我的第一个React Native项目,第一次使用Xcode.

我做了什么

  1. 我加react-native-firebasefirebase.
  2. react-native link react-native-firebase.
  3. 通过将GoogleService-Info.plist拖入Xcode编辑器,将其添加到项目中.
  4. 停止所有Xcode任务并退出Xcode.
  5. 做了一个pod init.
  6. 将podfile调整为以下内容:

    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'Enso' do
    # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
    # use_frameworks!
    
      # Pods for Enso
        pod 'Firebase/Core'
    
    end
    
    Run Code Online (Sandbox Code Playgroud)
  7. 做了一个 pod install
  8. 打开xcworkspace文件
  9. 新增的#import <Firebase.h> …

sigabrt ios firebase react-native react-native-firebase

12
推荐指数
1
解决办法
4179
查看次数

无法从 React-Native-Firebase(v6) Firestore 获取数据:undefined 不是函数(靠近 '...this._firestore.native.collectionGet...')

我已经被这个问题困住了这么久。我刚刚开始使用 react-native-firebase 在我的 react-native 应用程序中实现 Firestore。我只是在关注文档 [ https://invertase.io/oss/react-native-firebase/v6/firestore/quick-start#reading-data]但它对我不起作用。

这是在安卓中。尚未在 iOS 中测试。

我不断收到此错误:

[TypeError: undefined is not a function (near '...this._firestore.native.collectionGet...')]

这是相关的代码:

import React, {Component} from 'react';
import { firebase } from '@react-native-firebase/firestore';

export default App extends Component{
  constructor(props) {
    super(props);

    this.getData= this.getData.bind(this)
    this.getData()

    this.state = {};
  }

  async getData() {
    try {
      const querySnapshot = await firebase.firestore()
      .collection('Gyms')
      .get() //error with this

      console.log('Documents', querySnapshot.docs);

    } catch (e) {
      console.log(e);
    }
  }
}


Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激!

javascript firebase react-native google-cloud-firestore react-native-firebase

12
推荐指数
2
解决办法
2711
查看次数