Skip to content

Commit

Permalink
fix: add missing parameter when registering broadcast receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Jan 21, 2025
1 parent 75f09ac commit 7f5be35
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.PersistableBundle
import android.util.Log

Expand All @@ -27,7 +28,13 @@ class ReactNativeBackgroundTaskModule internal constructor(context: ReactApplica

init {
val filter = IntentFilter("com.expensify.reactnativebackgroundtask.TASK_ACTION")
reactApplicationContext.registerReceiver(taskReceiver, filter)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
reactApplicationContext.registerReceiver(
taskReceiver,
filter,
Context.RECEIVER_EXPORTED
)
}
}

override fun getName(): String {
Expand Down

0 comments on commit 7f5be35

Please sign in to comment.