@maximilien0405/capacitor-android-launcher 7.0.5 → 7.0.7

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.
@@ -111,8 +111,17 @@ public class AndroidLauncher {
111
111
  PackageManager packageManager = activity.getPackageManager();
112
112
  Intent intent = new Intent(Intent.ACTION_MAIN);
113
113
  intent.addCategory(Intent.CATEGORY_HOME);
114
- ResolveInfo resolveInfo = packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
115
- return resolveInfo.activityInfo.packageName.equals(activity.getPackageName());
114
+
115
+ // Get the default launcher by resolving the HOME intent
116
+ ResolveInfo defaultLauncher = packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
117
+
118
+ if (defaultLauncher == null) {
119
+ return false;
120
+ }
121
+
122
+ // Check if the default launcher is our app
123
+ String myPackageName = activity.getPackageName();
124
+ return defaultLauncher.activityInfo.packageName.equals(myPackageName);
116
125
  }
117
126
 
118
127
  // Listen to system UI changes and hide UI if swiped
package/dist/docs.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "parameters": [],
12
12
  "returns": "Promise<void>",
13
13
  "tags": [],
14
- "docs": "",
14
+ "docs": "Open the launcher settings page",
15
15
  "complexTypes": [],
16
16
  "slug": "openlaunchersettings"
17
17
  },
@@ -21,7 +21,7 @@
21
21
  "parameters": [],
22
22
  "returns": "Promise<void>",
23
23
  "tags": [],
24
- "docs": "",
24
+ "docs": "Start the immersive mode\nThis method hides all system UI elements, creating a full-screen experience",
25
25
  "complexTypes": [],
26
26
  "slug": "startimmersivemode"
27
27
  },
@@ -31,7 +31,7 @@
31
31
  "parameters": [],
32
32
  "returns": "Promise<void>",
33
33
  "tags": [],
34
- "docs": "",
34
+ "docs": "Stop the immersive mode",
35
35
  "complexTypes": [],
36
36
  "slug": "stopimmersivemode"
37
37
  },
@@ -41,7 +41,7 @@
41
41
  "parameters": [],
42
42
  "returns": "Promise<boolean>",
43
43
  "tags": [],
44
- "docs": "",
44
+ "docs": "Check if the app is the default launcher or not",
45
45
  "complexTypes": [],
46
46
  "slug": "islauncherapp"
47
47
  }
@@ -1,6 +1,19 @@
1
1
  export interface AndroidLauncherPlugin {
2
+ /**
3
+ * Open the launcher settings page
4
+ */
2
5
  openLauncherSettings(): Promise<void>;
6
+ /**
7
+ * Start the immersive mode
8
+ * This method hides all system UI elements, creating a full-screen experience
9
+ */
3
10
  startImmersiveMode(): Promise<void>;
11
+ /**
12
+ * Stop the immersive mode
13
+ */
4
14
  stopImmersiveMode(): Promise<void>;
15
+ /**
16
+ * Check if the app is the default launcher or not
17
+ */
5
18
  isLauncherApp(): Promise<boolean>;
6
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface AndroidLauncherPlugin {\n openLauncherSettings(): Promise<void>;\n startImmersiveMode(): Promise<void>;\n stopImmersiveMode(): Promise<void>;\n isLauncherApp(): Promise<boolean>;\n}"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface AndroidLauncherPlugin {\n /**\n * Open the launcher settings page\n */\n openLauncherSettings(): Promise<void>;\n\n /**\n * Start the immersive mode\n * This method hides all system UI elements, creating a full-screen experience\n */\n startImmersiveMode(): Promise<void>;\n\n /**\n * Stop the immersive mode\n */\n stopImmersiveMode(): Promise<void>;\n\n /**\n * Check if the app is the default launcher or not\n */\n isLauncherApp(): Promise<boolean>;\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maximilien0405/capacitor-android-launcher",
3
- "version": "7.0.5",
3
+ "version": "7.0.7",
4
4
  "description": "Capacitor plugin to request your app to be the main launcher.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",