How to debug networking react native ios with firebase

201 views Asked by At

I using react-native version 0.72.5 and @react-native-firebase/app 18.

when I config in Podfile, I add use_frameworks! :linkage => :static and comment

# :hermes_enabled => flags[:hermes_enabled],
# :fabric_enabled => flags[:fabric_enabled],
# :flipper_configuration => flipper_config,

I cannot use react-native-debugger and can only use flipper but networking is unavailable. How to debug it?

enter image description here

2

There are 2 answers

2
William Brochensque junior On

Looks like the flipper_configuration => flipper_config does some changes related to the Network Plugin Setup. You will need to add it manually, as follows:

To your podfile, add this:

pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version

Then, initialize the plugin, by adding into your AppDelegate.m:

If it uses Objective-C:

#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>

[[FlipperClient sharedClient] addPlugin: [[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];

If it uses Swift:

import FlipperKit

client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter()))

This should work for IOS.

You can read more about it and how to do it on Android on this page on the docs.

1
Thịnh Phạm On
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true,
    # :fabric_enabled => flags[:fabric_enabled],
    :fabric_enabled => false,
    :flipper_configuration => FlipperConfiguration.enabled(["Debug"], { 'Flipper' => '0.163.0' }),
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true
  pod 'FirebaseInstallations', :modular_headers => true
  pod 'GoogleDataTransport', :modular_headers => true
  pod 'nanopb', :modular_headers => true
  pod 'FirebaseSessions', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'Firebase/Messaging', :modular_headers => true
  pod 'Firebase/Analytics', :modular_headers => true

My podfile config, hope this help you