首页 文章

Firebase性能监控是否捕获了React Native Fetch API的请求?

提问于
浏览
1

我在2天前将Firebase性能监控安装到了我的React Native iOS项目中 . 昨天和今天,我查看了Firebase控制台中的“网络请求”选项卡 . 只有少数来自graph.facebook.com,googleapis.com和google.com/gcm的请求出现了 . 根本没有显示React Native代码中的Fetch API发出的API请求 .

我在https://firebase.google.com/docs/perf-mon/get-started-ios中按照步骤1-3进行了安装 . 以下是命令 pod install 中已安装的Pod列表:

Using Alamofire (4.5.1)
Using CocoaLumberjack (3.3.0)
Using FLAnimatedImage (1.0.12)
Using Firebase (4.8.0)
Using FirebaseAnalytics (4.0.5)
Using FirebaseCore (4.0.13)
Using FirebaseInstanceID (2.0.8)
Using FirebaseMessaging (2.0.8)
Using FirebasePerformance (1.1.0)
Using FirebaseSwizzlingUtilities (1.0.0)
Using GTMSessionFetcher (1.1.12)
Using GoogleToolboxForMac (2.1.3)
Using Kingfisher (4.2.0)
Using NYTPhotoViewer (1.3.0)
Using Protobuf (3.5.0)
Using SVGKit (2.0.1)
Using nanopb (0.3.8)

我从我的应用程序总共提出了大约50个请求,从那时起已经过了2天 . 是否足以显示请求?性能监控不支持React Native中的fetch API,还是需要额外的步骤才能使其工作?

2 回答

  • 0

    性能监视仅收集来自iOS上的NSURLSession和NSURLConnection的本机调用所进行的HTTP调用的数据 . 显然,React Native做了不同的事情来提出请求 .

    如果要手动记录和收集有关HTTP请求的信息,可以使用this native API .

  • 0

    经过2天后,请求终于开始出现在控制台中(即使它们尚未分类) . 以下是我的问题的答案:

    问:Firebase性能监控是否捕获了React Native Fetch API的请求? A: Yes

    问:我从我的应用程序中总共提出了大约50个请求,从那时起已经过了2天 . 是否足以显示请求?

    A: Might not enough. I think I started seeing requests after 100+ samples.

    问:性能监控不支持React Native中的fetch API,还是需要额外的步骤来使其工作?

    A: Performance Monitoring does support fetch API. No extra step required. The only things required are enough time passed and enough samples collected.

相关问题