native-update 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -49,7 +49,7 @@ class BackgroundUpdatePlugin : Plugin() {
|
|
|
49
49
|
if (config.enabled) {
|
|
50
50
|
scheduleBackgroundWork(config.checkInterval.toLong())
|
|
51
51
|
} else {
|
|
52
|
-
|
|
52
|
+
cancelAllBackgroundWork()
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
call.resolve()
|
|
@@ -113,7 +113,7 @@ class BackgroundUpdatePlugin : Plugin() {
|
|
|
113
113
|
call.resolve(JSObject().put("granted", granted))
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
internal fun cancelAllBackgroundWork() {
|
|
117
117
|
backgroundUpdateStatus.enabled = false
|
|
118
118
|
backgroundUpdateStatus.isRunning = false
|
|
119
119
|
backgroundUpdateStatus.currentTaskId = null
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.aoneahsan.nativeupdate
|
|
2
2
|
|
|
3
|
+
import com.getcapacitor.JSObject
|
|
3
4
|
import com.getcapacitor.Plugin
|
|
4
5
|
import com.getcapacitor.PluginCall
|
|
5
6
|
import com.getcapacitor.PluginMethod
|
|
@@ -86,7 +87,7 @@ class NativeUpdatePlugin : Plugin() {
|
|
|
86
87
|
try {
|
|
87
88
|
// Clean up any resources
|
|
88
89
|
liveUpdatePlugin.cleanup()
|
|
89
|
-
backgroundUpdatePlugin.
|
|
90
|
+
backgroundUpdatePlugin.cancelAllBackgroundWork()
|
|
90
91
|
call.resolve()
|
|
91
92
|
} catch (e: Exception) {
|
|
92
93
|
call.reject("Cleanup failed", e)
|