Skip to content

Commit

Permalink
Attempt to fix Google Play rejection error with RECEIVER patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdowney committed Aug 11, 2024
1 parent 234a80c commit 3cf99b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
14 changes: 14 additions & 0 deletions android/app/src/main/java/com/podverse/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
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;

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.
Expand All @@ -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);
Expand Down

0 comments on commit 3cf99b3

Please sign in to comment.