Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/NewExpensify/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "RCTStartupTimer.h"
#import <HardwareShortcuts.h>
#import <BackgroundTasks/BackgroundTasks.h>
#import <expensify-react-native-background-task/RNBackgroundTaskManager.h>
#import <expensify_react_native_background_task/RNBackgroundTaskManager.h>

@interface AppDelegate () <UNUserNotificationCenterDelegate>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ class ReactNativeBackgroundTaskModule internal constructor(context: ReactApplica
return NAME
}

override fun invalidate() {
super.invalidate()
try {
reactApplicationContext.unregisterReceiver(taskReceiver)
Log.d("ReactNativeBackgroundTaskModule", "BroadcastReceiver unregistered")
} catch (e: IllegalArgumentException) {
Log.w("ReactNativeBackgroundTaskModule", "Receiver not registered or already unregistered")
}
}

@ReactMethod
override fun defineTask(taskName: String, taskExecutor: Callback, promise: Promise) {
try {
Expand Down
Loading