Skip to content

Commit

Permalink
Merge pull request #55513 from callstack-internal/fix/add-missing-par…
Browse files Browse the repository at this point in the history
…amater-when-registering-broadcast-receiver

fix: add missing parameter when registering broadcast receiver
(cherry picked from commit d2ffb9c)

(CP triggered by Beamanator)
  • Loading branch information
lakchote authored and OSBotify committed Jan 21, 2025
1 parent 012abe8 commit 4ccb6ec
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 4ccb6ec

Please sign in to comment.