@capgo/capacitor-updater 5.0.10 → 5.0.13
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.
|
@@ -55,7 +55,7 @@ public class CapacitorUpdaterPlugin
|
|
|
55
55
|
private static final String channelUrlDefault =
|
|
56
56
|
"https://api.capgo.app/channel_self";
|
|
57
57
|
|
|
58
|
-
private final String PLUGIN_VERSION = "5.0.
|
|
58
|
+
private final String PLUGIN_VERSION = "5.0.13";
|
|
59
59
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
60
60
|
|
|
61
61
|
private SharedPreferences.Editor editor;
|
|
@@ -1237,17 +1237,22 @@ public class CapacitorUpdaterPlugin
|
|
|
1237
1237
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
1238
1238
|
return false;
|
|
1239
1239
|
}
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
.
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1240
|
+
try {
|
|
1241
|
+
Context mContext = this.getContext();
|
|
1242
|
+
ActivityManager activityManager =
|
|
1243
|
+
(ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
|
1244
|
+
List<ActivityManager.AppTask> runningTasks =
|
|
1245
|
+
activityManager.getAppTasks();
|
|
1246
|
+
ActivityManager.RecentTaskInfo runningTask = runningTasks
|
|
1247
|
+
.get(0)
|
|
1248
|
+
.getTaskInfo();
|
|
1249
|
+
String className = runningTask.baseIntent.getComponent().getClassName();
|
|
1250
|
+
String runningActivity = runningTask.topActivity.getClassName();
|
|
1251
|
+
boolean isThisAppActivity = className.equals(runningActivity);
|
|
1252
|
+
return isThisAppActivity;
|
|
1253
|
+
} catch (NullPointerException e) {
|
|
1254
|
+
return false;
|
|
1255
|
+
}
|
|
1251
1256
|
}
|
|
1252
1257
|
|
|
1253
1258
|
private void appKilled() {
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
private var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "5.0.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.0.13"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|
package/package.json
CHANGED