diff --git a/android/app/build.gradle b/android/app/build.gradle index a13053247..8647e2c27 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -210,6 +210,8 @@ dependencies { implementation "com.google.crypto.tink:apps-webpush:1.9.1" implementation 'com.github.lovegaoshi:KotlinAudio:v2.0.0-aa22' + implementation 'org.jetbrains:annotations:16.0.2' + if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") diff --git a/android/app/src/main/java/com/podverse/MainActivity.java b/android/app/src/main/java/com/podverse/MainActivity.java index 40ef5bc5f..be709ee36 100644 --- a/android/app/src/main/java/com/podverse/MainActivity.java +++ b/android/app/src/main/java/com/podverse/MainActivity.java @@ -7,7 +7,10 @@ import android.os.Build; import android.os.Bundle; +import android.content.BroadcastReceiver; +import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.util.Log; @@ -15,6 +18,8 @@ import org.json.JSONException; import org.json.JSONObject; +import org.jetbrains.annotations.Nullable; + public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. @@ -25,6 +30,15 @@ protected String getMainComponentName() { return "podverse"; } + @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); + } else { + return super.registerReceiver(receiver, filter); + } + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(null);