@capgo/capacitor-updater 5.0.11 → 5.0.14

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.11";
58
+ private final String PLUGIN_VERSION = "5.0.14";
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
- Context mContext = this.getContext();
1241
- ActivityManager activityManager =
1242
- (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
1243
- List<ActivityManager.AppTask> runningTasks = activityManager.getAppTasks();
1244
- ActivityManager.RecentTaskInfo runningTask = runningTasks
1245
- .get(0)
1246
- .getTaskInfo();
1247
- String className = runningTask.baseIntent.getComponent().getClassName();
1248
- String runningActivity = runningTask.topActivity.getClassName();
1249
- boolean isThisAppActivity = className.equals(runningActivity);
1250
- return isThisAppActivity;
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.11"
18
+ private let PLUGIN_VERSION: String = "5.0.14"
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "5.0.11",
4
- "packageManager": "pnpm@8.6.10",
3
+ "version": "5.0.14",
4
+ "packageManager": "pnpm@8.6.11",
5
5
  "license": "MPL-2.0",
6
6
  "description": "Live update for capacitor apps",
7
7
  "main": "dist/plugin.cjs.js",