1

I installed Firebase Performance Monitoring to my React Native iOS project 2 days ago. Yesterday and today I looked into Network Requests tab in Firebase Console. Only few requests from graph.facebook.com, googleapis.com, and google.com/gcm appeared. None of API requests made by Fetch API in React Native code was displayed at all.

The installation I made followed step 1-3 in https://firebase.google.com/docs/perf-mon/get-started-ios. Here are list of installed Pods from the command pod install:

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)

I made around 50 requests in total from my app and 2 days has passed since then. Was that enough for the requests to be displayed? Is fetch API in React Native not supported by Performance Monitoring or is there any extra step required to make it work?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
PaperMonster
  • 153
  • 1
  • 7

2 Answers2

2

After 2 days passed, requests finally started to appear in the console (even they hadn't been categorized). So here are answers to my questions:

Q: Are requests made by React Native Fetch API captured by Firebase Performance Monitoring? A: Yes

Q: I made around 50 requests in total from my app and 2 days has passed since then. Was that enough for the requests to be displayed?

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

Q: Is fetch API in React Native not supported by Performance Monitoring or is there any extra step required to make it work?

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

PaperMonster
  • 153
  • 1
  • 7
  • Thanks for posting the followup! In general, there's currently a lag of about a day for traces to be reflected in the console. For network requests, there's also a minimum number of samples before they're broken out into separate paths. See the note attached to https://firebase.google.com/docs/perf-mon/help#monitor_https_network_requests – Eric Shieh Jan 12 '18 at 22:32
0

Performance Monitoring only collects data from HTTP calls made by native calls to NSURLSession and NSURLConnection on iOS. Apparently React Native does something different to make requests.

If you want to manually record and collect information about HTTP requests, you can use this native API.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • I saw [this thread](https://stackoverflow.com/a/38093687/9196512) stated that fetch API uses NSURLSession internally. Is this statement invalid or is there other factor that prevents the request from being collected? – PaperMonster Jan 10 '18 at 13:08