11/**
2- * Copyright (c) Facebook , Inc. and its affiliates.
2+ * Copyright (c) Meta Platforms , Inc. and affiliates.
33 *
44 * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
55 * directory of this source tree.
66 */
77package com .awesomeproject ;
8-
98import android .content .Context ;
109import com .facebook .flipper .android .AndroidFlipperClient ;
1110import com .facebook .flipper .android .utils .FlipperUtils ;
1918import com .facebook .flipper .plugins .network .NetworkFlipperPlugin ;
2019import com .facebook .flipper .plugins .react .ReactFlipperPlugin ;
2120import com .facebook .flipper .plugins .sharedpreferences .SharedPreferencesFlipperPlugin ;
21+ import com .facebook .react .ReactInstanceEventListener ;
2222import com .facebook .react .ReactInstanceManager ;
2323import com .facebook .react .bridge .ReactContext ;
2424import com .facebook .react .modules .network .NetworkingModule ;
2525import okhttp3 .OkHttpClient ;
26-
2726public class ReactNativeFlipper {
2827 public static void initializeFlipper (Context context , ReactInstanceManager reactInstanceManager ) {
2928 if (FlipperUtils .shouldEnableFlipper (context )) {
3029 final FlipperClient client = AndroidFlipperClient .getInstance (context );
31-
3230 client .addPlugin (new InspectorFlipperPlugin (context , DescriptorMapping .withDefaults ()));
3331 client .addPlugin (new ReactFlipperPlugin ());
3432 client .addPlugin (new DatabasesFlipperPlugin (context ));
3533 client .addPlugin (new SharedPreferencesFlipperPlugin (context ));
3634 client .addPlugin (CrashReporterPlugin .getInstance ());
37-
3835 NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin ();
3936 NetworkingModule .setCustomClientBuilder (
4037 new NetworkingModule .CustomClientBuilder () {
@@ -45,13 +42,12 @@ public void apply(OkHttpClient.Builder builder) {
4542 });
4643 client .addPlugin (networkFlipperPlugin );
4744 client .start ();
48-
4945 // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
5046 // Hence we run if after all native modules have been initialized
5147 ReactContext reactContext = reactInstanceManager .getCurrentReactContext ();
5248 if (reactContext == null ) {
5349 reactInstanceManager .addReactInstanceEventListener (
54- new ReactInstanceManager . ReactInstanceEventListener () {
50+ new ReactInstanceEventListener () {
5551 @ Override
5652 public void onReactContextInitialized (ReactContext reactContext ) {
5753 reactInstanceManager .removeReactInstanceEventListener (this );
@@ -69,4 +65,4 @@ public void run() {
6965 }
7066 }
7167 }
72- }
68+ }
0 commit comments