Skip to content

Commit

Permalink
ADD registerReceiver Override method
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Oct 2, 2024
1 parent 6d6fda5 commit 0edd95f
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ public void onCreate() {
initializeFlipper(
this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled
}

@Override
public Intent registerReceiver(@Nullable BroadcastReceiver receiver, IntentFilter filter) {
if (Build.VERSION.SDK_INT >= 34 && getApplicationInfo().targetSdkVersion >= 34) {
return super.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED); // or RECEIVER_NOT_EXPORTED
} else {
return super.registerReceiver(receiver, filter);
}
}
public static Context getAppContext() { return appContext; }

/**
Expand All @@ -62,7 +69,7 @@ public void onCreate() {
private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
/*`
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Expand Down

0 comments on commit 0edd95f

Please sign in to comment.