foreground-location 0.0.1 → 0.0.2

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.
@@ -17,6 +17,10 @@
17
17
  <!-- Internet access for Google Play Services -->
18
18
  <uses-permission android:name="android.permission.INTERNET" />
19
19
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
20
+
21
+ <!-- Wakelock and Battery Optimization -->
22
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
23
+ <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
20
24
 
21
25
  <application>
22
26
  <!-- Foreground Location Service -->
@@ -3,6 +3,7 @@ package in.xconcepts.foreground.location;
3
3
  import android.content.Context;
4
4
  import android.os.Handler;
5
5
  import android.os.Looper;
6
+ import android.os.PowerManager;
6
7
  import android.util.Log;
7
8
 
8
9
  import org.json.JSONArray;
@@ -47,13 +48,15 @@ public class APIService {
47
48
  private List<JSONObject> locationDataBuffer;
48
49
  private List<JSONObject> failedDataBuffer;
49
50
  private Runnable apiTask;
50
- private boolean isRunning = false;
51
+ private volatile boolean isRunning = false;
51
52
 
52
53
  // Circuit breaker pattern
53
54
  private boolean circuitBreakerOpen = false;
54
55
  private long circuitBreakerOpenTime = 0;
55
56
  private int consecutiveFailures = 0;
56
57
 
58
+ private PowerManager.WakeLock wakeLock;
59
+
57
60
  public APIService(Context context) {
58
61
  this.context = context;
59
62
  this.executorService = Executors.newSingleThreadExecutor();
@@ -61,6 +64,13 @@ public class APIService {
61
64
  this.locationDataBuffer = new ArrayList<>();
62
65
  this.failedDataBuffer = new ArrayList<>();
63
66
  this.headers = new HashMap<>();
67
+
68
+ // Initialize Wakelock for API calls
69
+ PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
70
+ if (powerManager != null) {
71
+ this.wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ForegroundLocation:APIService");
72
+ this.wakeLock.setReferenceCounted(false);
73
+ }
64
74
  }
65
75
 
66
76
  public void configure(String url, String type, Map<String, String> headers,
@@ -112,9 +122,32 @@ public class APIService {
112
122
  public void run() {
113
123
  if (isRunning) {
114
124
  executorService.execute(() -> {
115
- sendLocationData();
116
- if (isRunning) {
117
- mainHandler.postDelayed(this, apiIntervalMs);
125
+ // Acquire wakelock to ensure API call completes
126
+ try {
127
+ if (wakeLock != null) {
128
+ wakeLock.acquire(10 * 60 * 1000L); // 10 minute timeout safety
129
+ }
130
+ } catch (Exception e) {
131
+ Log.e(TAG, "Error acquiring wakelock", e);
132
+ }
133
+
134
+ try {
135
+ sendLocationData();
136
+ } catch (Exception e) {
137
+ Log.e(TAG, "Error in API processing loop", e);
138
+ } finally {
139
+ // Helper to release lock
140
+ try {
141
+ if (wakeLock != null && wakeLock.isHeld()) {
142
+ wakeLock.release();
143
+ }
144
+ } catch (Exception e) {
145
+ Log.e(TAG, "Error releasing wakelock", e);
146
+ }
147
+
148
+ if (isRunning) {
149
+ mainHandler.postDelayed(this, apiIntervalMs);
150
+ }
118
151
  }
119
152
  });
120
153
  }
@@ -9,8 +9,11 @@ import android.content.IntentFilter;
9
9
  import android.content.ServiceConnection;
10
10
  import android.content.pm.PackageManager;
11
11
  import android.location.Location;
12
+ import android.net.Uri;
12
13
  import android.os.Build;
13
14
  import android.os.IBinder;
15
+ import android.os.PowerManager;
16
+ import android.provider.Settings;
14
17
  import android.util.Log;
15
18
 
16
19
  import androidx.core.content.ContextCompat;
@@ -235,6 +238,52 @@ public class ForeGroundLocationPlugin extends Plugin {
235
238
  checkPermissions(call);
236
239
  }
237
240
 
241
+ @PluginMethod
242
+ public void checkBatteryOptimization(PluginCall call) {
243
+ Context context = getContext();
244
+ String packageName = context.getPackageName();
245
+ PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
246
+ boolean isIgnoringBatteryOptimizations = false;
247
+
248
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
249
+ isIgnoringBatteryOptimizations = pm.isIgnoringBatteryOptimizations(packageName);
250
+ } else {
251
+ isIgnoringBatteryOptimizations = true; // Not applicable on older versions
252
+ }
253
+
254
+ JSObject ret = new JSObject();
255
+ ret.put("isIgnoringBatteryOptimizations", isIgnoringBatteryOptimizations);
256
+ call.resolve(ret);
257
+ }
258
+
259
+ @PluginMethod
260
+ public void requestBatteryOptimizationIgnore(PluginCall call) {
261
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
262
+ call.resolve();
263
+ return;
264
+ }
265
+
266
+ Context context = getContext();
267
+ String packageName = context.getPackageName();
268
+ PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
269
+
270
+ if (pm.isIgnoringBatteryOptimizations(packageName)) {
271
+ call.resolve();
272
+ return;
273
+ }
274
+
275
+ try {
276
+ Intent intent = new Intent();
277
+ intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
278
+ intent.setData(Uri.parse("package:" + packageName));
279
+ getBridge().getActivity().startActivity(intent);
280
+ call.resolve();
281
+ } catch (Exception e) {
282
+ Log.e(TAG, "Error requesting battery optimization ignore", e);
283
+ call.reject("Failed to open battery optimization settings");
284
+ }
285
+ }
286
+
238
287
  /**
239
288
  * Start foreground location service with notification configuration
240
289
  *
@@ -361,7 +410,7 @@ public class ForeGroundLocationPlugin extends Plugin {
361
410
 
362
411
  Integer apiInterval = apiConfig.getInteger("apiInterval", 5);
363
412
  if (apiInterval != null && apiInterval > 0) {
364
- serviceIntent.putExtra("apiInterval", apiInterval);
413
+ serviceIntent.putExtra("apiInterval", apiInterval.intValue());
365
414
  } else {
366
415
  serviceIntent.putExtra("apiInterval", 5); // Default 5 minutes
367
416
  }
@@ -13,6 +13,7 @@ import android.os.Binder;
13
13
  import android.os.Build;
14
14
  import android.os.IBinder;
15
15
  import android.os.Looper;
16
+ import android.os.PowerManager;
16
17
  import android.util.Log;
17
18
 
18
19
  import androidx.annotation.NonNull;
@@ -76,6 +77,8 @@ public class LocationForegroundService extends Service {
76
77
  private JSONObject apiAdditionalParams;
77
78
  private int apiIntervalMinutes = 5;
78
79
 
80
+ private PowerManager.WakeLock wakeLock;
81
+
79
82
  private final IBinder binder = new LocationServiceBinder();
80
83
 
81
84
  public class LocationServiceBinder extends Binder {
@@ -93,12 +96,26 @@ public class LocationForegroundService extends Service {
93
96
  notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
94
97
  apiService = new APIService(this); // Initialize API service
95
98
 
99
+ // Initialize Service Wakelock
100
+ PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
101
+ if (powerManager != null) {
102
+ wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ForegroundLocation:ServiceWakeLock");
103
+ wakeLock.setReferenceCounted(false);
104
+ }
105
+
96
106
  createNotificationChannel();
97
107
  setupLocationCallback();
98
108
  }
99
109
 
100
110
  @Override
101
111
  public int onStartCommand(Intent intent, int flags, int startId) {
112
+
113
+ // Acquire service wakelock
114
+ if (wakeLock != null && !wakeLock.isHeld()) {
115
+ wakeLock.acquire();
116
+ Log.d(TAG, "Service Wakelock acquired");
117
+ }
118
+
102
119
  Log.d(TAG, "LocationForegroundService started");
103
120
 
104
121
  if (intent != null) {
@@ -120,6 +137,12 @@ public class LocationForegroundService extends Service {
120
137
  @Override
121
138
  public void onDestroy() {
122
139
  Log.d(TAG, "LocationForegroundService destroyed");
140
+ // Release service wakelock
141
+ if (wakeLock != null && wakeLock.isHeld()) {
142
+ wakeLock.release();
143
+ Log.d(TAG, "Service Wakelock released");
144
+ }
145
+
123
146
  stopLocationUpdates();
124
147
 
125
148
  // Cleanup API service
@@ -11,6 +11,18 @@ export interface ForeGroundLocationPlugin {
11
11
  * @since 1.0.0
12
12
  */
13
13
  requestPermissions(): Promise<LocationPermissionStatus>;
14
+ /**
15
+ * Check if battery optimizations are ignored
16
+ * @since 1.0.0
17
+ */
18
+ checkBatteryOptimization(): Promise<{
19
+ isIgnoringBatteryOptimizations: boolean;
20
+ }>;
21
+ /**
22
+ * Request to ignore battery optimizations
23
+ * @since 1.0.0
24
+ */
25
+ requestBatteryOptimizationIgnore(): Promise<void>;
14
26
  /**
15
27
  * Start foreground location service
16
28
  * @since 1.0.0
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAqQA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;IAExD;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;CACpC,CAAC","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n// Re-export Capacitor types for user convenience\nexport type { PermissionState, PluginListenerHandle };\n\nexport interface ForeGroundLocationPlugin {\n /**\n * Check current permission status\n * @since 1.0.0\n */\n checkPermissions(): Promise<LocationPermissionStatus>;\n\n /**\n * Request location permissions\n * @since 1.0.0\n */\n requestPermissions(): Promise<LocationPermissionStatus>;\n\n /**\n * Start foreground location service\n * @since 1.0.0\n */\n startForegroundLocationService(options: LocationServiceOptions): Promise<void>;\n\n /**\n * Stop foreground location service\n * @since 1.0.0\n */\n stopForegroundLocationService(): Promise<void>;\n\n /**\n * Check if location service is running\n * @since 1.0.0\n */\n isServiceRunning(): Promise<{ isRunning: boolean }>;\n\n /**\n * Get current location once\n * @since 1.0.0\n */\n getCurrentLocation(): Promise<LocationResult>;\n\n /**\n * Update location service settings\n * @since 1.0.0\n */\n updateLocationSettings(options: LocationServiceOptions): Promise<void>;\n\n /**\n * Get API service status\n * @since 1.0.0\n */\n getApiServiceStatus(): Promise<ApiServiceStatus>;\n\n /**\n * Clear API service buffers\n * @since 1.0.0\n */\n clearApiBuffers(): Promise<void>;\n\n /**\n * Reset API service circuit breaker\n * @since 1.0.0\n */\n resetApiCircuitBreaker(): Promise<void>;\n\n /**\n * Listen for location updates\n * @since 1.0.0\n */\n addListener(\n eventName: 'locationUpdate',\n listenerFunc: (location: LocationResult) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for service status changes\n * @since 1.0.0\n */\n addListener(\n eventName: 'serviceStatusChanged',\n listenerFunc: (status: ServiceStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\nexport interface LocationServiceOptions {\n /**\n * Update interval in milliseconds\n * @default 60000\n * @minimum 1000\n */\n interval?: number;\n\n /**\n * Fastest update interval in milliseconds\n * @default 30000\n * @minimum 1000\n */\n fastestInterval?: number;\n\n /**\n * Location accuracy priority\n * @default 'HIGH_ACCURACY'\n */\n priority?: 'HIGH_ACCURACY' | 'BALANCED_POWER' | 'LOW_POWER' | 'NO_POWER';\n\n /**\n * Notification configuration for foreground service (REQUIRED)\n */\n notification: {\n /**\n * Notification title (REQUIRED)\n */\n title: string;\n /**\n * Notification text/content (REQUIRED)\n */\n text: string;\n /**\n * Optional notification icon resource name\n */\n icon?: string;\n };\n\n /**\n * Enable high accuracy mode\n * @default true\n */\n enableHighAccuracy?: boolean;\n\n /**\n * Minimum distance in meters to trigger update\n */\n distanceFilter?: number;\n\n /**\n * API service configuration (optional)\n * If provided, location data will be sent to the specified API endpoint in batches\n */\n api?: ApiServiceConfig;\n}\n\nexport interface ApiServiceConfig {\n /**\n * API endpoint URL (REQUIRED if api config is provided)\n */\n url: string;\n\n /**\n * HTTP method to use\n * @default 'POST'\n */\n type?: 'GET' | 'POST' | 'PUT' | 'PATCH';\n\n /**\n * HTTP headers to include in API requests\n */\n header?: Record<string, string>;\n\n /**\n * Additional parameters to include in API request body\n */\n additionalParams?: Record<string, any>;\n\n /**\n * Interval in minutes for sending batched location data to API\n * @default 5\n * @minimum 1\n */\n apiInterval?: number;\n}\n\nexport interface ApiServiceStatus {\n /**\n * Whether API service is enabled and configured\n */\n isEnabled: boolean;\n\n /**\n * Number of location points in buffer waiting to be sent\n */\n bufferSize: number;\n\n /**\n * Whether API service is healthy (not in circuit breaker state)\n */\n isHealthy: boolean;\n}\n\nexport interface LocationResult {\n /**\n * Latitude in decimal degrees\n */\n latitude: number;\n\n /**\n * Longitude in decimal degrees\n */\n longitude: number;\n\n /**\n * Accuracy of the location in meters\n */\n accuracy: number;\n\n /**\n * Altitude in meters (if available)\n */\n altitude?: number;\n\n /**\n * Bearing in degrees (if available)\n */\n bearing?: number;\n\n /**\n * Speed in meters per second (if available)\n */\n speed?: number;\n\n /**\n * Timestamp in ISO 8601 format\n */\n timestamp: string;\n}\n\nexport interface LocationPermissionStatus {\n /**\n * Fine and coarse location permission status\n */\n location: PermissionState;\n\n /**\n * Background location permission status (Android 10+)\n */\n backgroundLocation: PermissionState;\n\n /**\n * Notification permission status (Android 13+)\n */\n notifications: PermissionState;\n}\n\nexport interface ServiceStatus {\n /**\n * Whether the service is currently running\n */\n isRunning: boolean;\n\n /**\n * Error message if service failed\n */\n error?: string;\n}\n\n/**\n * Plugin error codes for consistent error handling\n */\nexport const ERROR_CODES = {\n /**\n * Location permission denied or not granted\n */\n PERMISSION_DENIED: 'PERMISSION_DENIED',\n\n /**\n * Invalid notification configuration\n */\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\n\n /**\n * Invalid parameters provided\n */\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\n\n /**\n * Location services disabled\n */\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\n\n /**\n * Feature not supported on current platform\n */\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\n} as const;\n\nexport type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAiRA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;IAExD;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;CACpC,CAAC","sourcesContent":["import type { PermissionState, PluginListenerHandle } from '@capacitor/core';\n\n// Re-export Capacitor types for user convenience\nexport type { PermissionState, PluginListenerHandle };\n\nexport interface ForeGroundLocationPlugin {\n /**\n * Check current permission status\n * @since 1.0.0\n */\n checkPermissions(): Promise<LocationPermissionStatus>;\n\n /**\n * Request location permissions\n * @since 1.0.0\n */\n requestPermissions(): Promise<LocationPermissionStatus>;\n\n /**\n * Check if battery optimizations are ignored\n * @since 1.0.0\n */\n checkBatteryOptimization(): Promise<{ isIgnoringBatteryOptimizations: boolean }>;\n\n /**\n * Request to ignore battery optimizations\n * @since 1.0.0\n */\n requestBatteryOptimizationIgnore(): Promise<void>;\n\n /**\n * Start foreground location service\n * @since 1.0.0\n */\n startForegroundLocationService(options: LocationServiceOptions): Promise<void>;\n\n /**\n * Stop foreground location service\n * @since 1.0.0\n */\n stopForegroundLocationService(): Promise<void>;\n\n /**\n * Check if location service is running\n * @since 1.0.0\n */\n isServiceRunning(): Promise<{ isRunning: boolean }>;\n\n /**\n * Get current location once\n * @since 1.0.0\n */\n getCurrentLocation(): Promise<LocationResult>;\n\n /**\n * Update location service settings\n * @since 1.0.0\n */\n updateLocationSettings(options: LocationServiceOptions): Promise<void>;\n\n /**\n * Get API service status\n * @since 1.0.0\n */\n getApiServiceStatus(): Promise<ApiServiceStatus>;\n\n /**\n * Clear API service buffers\n * @since 1.0.0\n */\n clearApiBuffers(): Promise<void>;\n\n /**\n * Reset API service circuit breaker\n * @since 1.0.0\n */\n resetApiCircuitBreaker(): Promise<void>;\n\n /**\n * Listen for location updates\n * @since 1.0.0\n */\n addListener(\n eventName: 'locationUpdate',\n listenerFunc: (location: LocationResult) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Listen for service status changes\n * @since 1.0.0\n */\n addListener(\n eventName: 'serviceStatusChanged',\n listenerFunc: (status: ServiceStatus) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Remove all listeners\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n}\n\nexport interface LocationServiceOptions {\n /**\n * Update interval in milliseconds\n * @default 60000\n * @minimum 1000\n */\n interval?: number;\n\n /**\n * Fastest update interval in milliseconds\n * @default 30000\n * @minimum 1000\n */\n fastestInterval?: number;\n\n /**\n * Location accuracy priority\n * @default 'HIGH_ACCURACY'\n */\n priority?: 'HIGH_ACCURACY' | 'BALANCED_POWER' | 'LOW_POWER' | 'NO_POWER';\n\n /**\n * Notification configuration for foreground service (REQUIRED)\n */\n notification: {\n /**\n * Notification title (REQUIRED)\n */\n title: string;\n /**\n * Notification text/content (REQUIRED)\n */\n text: string;\n /**\n * Optional notification icon resource name\n */\n icon?: string;\n };\n\n /**\n * Enable high accuracy mode\n * @default true\n */\n enableHighAccuracy?: boolean;\n\n /**\n * Minimum distance in meters to trigger update\n */\n distanceFilter?: number;\n\n /**\n * API service configuration (optional)\n * If provided, location data will be sent to the specified API endpoint in batches\n */\n api?: ApiServiceConfig;\n}\n\nexport interface ApiServiceConfig {\n /**\n * API endpoint URL (REQUIRED if api config is provided)\n */\n url: string;\n\n /**\n * HTTP method to use\n * @default 'POST'\n */\n type?: 'GET' | 'POST' | 'PUT' | 'PATCH';\n\n /**\n * HTTP headers to include in API requests\n */\n header?: Record<string, string>;\n\n /**\n * Additional parameters to include in API request body\n */\n additionalParams?: Record<string, any>;\n\n /**\n * Interval in minutes for sending batched location data to API\n * @default 5\n * @minimum 1\n */\n apiInterval?: number;\n}\n\nexport interface ApiServiceStatus {\n /**\n * Whether API service is enabled and configured\n */\n isEnabled: boolean;\n\n /**\n * Number of location points in buffer waiting to be sent\n */\n bufferSize: number;\n\n /**\n * Whether API service is healthy (not in circuit breaker state)\n */\n isHealthy: boolean;\n}\n\nexport interface LocationResult {\n /**\n * Latitude in decimal degrees\n */\n latitude: number;\n\n /**\n * Longitude in decimal degrees\n */\n longitude: number;\n\n /**\n * Accuracy of the location in meters\n */\n accuracy: number;\n\n /**\n * Altitude in meters (if available)\n */\n altitude?: number;\n\n /**\n * Bearing in degrees (if available)\n */\n bearing?: number;\n\n /**\n * Speed in meters per second (if available)\n */\n speed?: number;\n\n /**\n * Timestamp in ISO 8601 format\n */\n timestamp: string;\n}\n\nexport interface LocationPermissionStatus {\n /**\n * Fine and coarse location permission status\n */\n location: PermissionState;\n\n /**\n * Background location permission status (Android 10+)\n */\n backgroundLocation: PermissionState;\n\n /**\n * Notification permission status (Android 13+)\n */\n notifications: PermissionState;\n}\n\nexport interface ServiceStatus {\n /**\n * Whether the service is currently running\n */\n isRunning: boolean;\n\n /**\n * Error message if service failed\n */\n error?: string;\n}\n\n/**\n * Plugin error codes for consistent error handling\n */\nexport const ERROR_CODES = {\n /**\n * Location permission denied or not granted\n */\n PERMISSION_DENIED: 'PERMISSION_DENIED',\n\n /**\n * Invalid notification configuration\n */\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\n\n /**\n * Invalid parameters provided\n */\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\n\n /**\n * Location services disabled\n */\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\n\n /**\n * Feature not supported on current platform\n */\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\n} as const;\n\nexport type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -3,6 +3,10 @@ import type { ForeGroundLocationPlugin, LocationPermissionStatus, LocationResult
3
3
  export declare class ForeGroundLocationWeb extends WebPlugin implements ForeGroundLocationPlugin {
4
4
  checkPermissions(): Promise<LocationPermissionStatus>;
5
5
  requestPermissions(): Promise<LocationPermissionStatus>;
6
+ checkBatteryOptimization(): Promise<{
7
+ isIgnoringBatteryOptimizations: boolean;
8
+ }>;
9
+ requestBatteryOptimizationIgnore(): Promise<void>;
6
10
  startForegroundLocationService(): Promise<void>;
7
11
  stopForegroundLocationService(): Promise<void>;
8
12
  isServiceRunning(): Promise<{
package/dist/esm/web.js CHANGED
@@ -30,6 +30,13 @@ export class ForeGroundLocationWeb extends WebPlugin {
30
30
  async requestPermissions() {
31
31
  throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');
32
32
  }
33
+ async checkBatteryOptimization() {
34
+ return { isIgnoringBatteryOptimizations: true };
35
+ }
36
+ async requestBatteryOptimizationIgnore() {
37
+ console.warn('Battery optimization is not applicable on web');
38
+ return;
39
+ }
33
40
  async startForegroundLocationService() {
34
41
  throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');
35
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAElD,KAAK,CAAC,gBAAgB;QACpB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;YACpC,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1B,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;SACzE;QAED,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1B,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;SACzE;QAED,IAAI;YACF,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,aAA+B,EAAE,CAAC,CAAC;YAChG,OAAO;gBACL,QAAQ,EAAE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esContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ForeGroundLocationPlugin,\n LocationPermissionStatus,\n LocationResult,\n ApiServiceStatus\n} from './definitions';\n\nexport class ForeGroundLocationWeb extends WebPlugin implements ForeGroundLocationPlugin {\n\n async checkPermissions(): Promise<LocationPermissionStatus> {\n if (typeof navigator === 'undefined') {\n throw this.unavailable('Navigator not available');\n }\n\n if (!navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n\n if (!navigator.geolocation) {\n throw this.unavailable('Geolocation API not available in this browser');\n }\n\n try {\n const permission = await navigator.permissions.query({ name: 'geolocation' as PermissionName });\n return {\n location: permission.state as any,\n backgroundLocation: 'denied',\n notifications: 'denied'\n };\n } catch (error) {\n // Fallback for browsers that support geolocation but not permissions query\n return {\n location: 'prompt',\n backgroundLocation: 'denied',\n notifications: 'denied'\n };\n }\n }\n\n async requestPermissions(): Promise<LocationPermissionStatus> {\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\n }\n\n async startForegroundLocationService(): Promise<void> {\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\n }\n\n async stopForegroundLocationService(): Promise<void> {\n throw this.unimplemented('Foreground location service not supported on web.');\n }\n\n async isServiceRunning(): Promise<{ isRunning: boolean }> {\n return { isRunning: false };\n }\n\n async getCurrentLocation(): Promise<LocationResult> {\n if (typeof navigator === 'undefined') {\n throw this.unavailable('Navigator not available');\n }\n\n if (!navigator.geolocation) {\n throw this.unavailable('Geolocation API not available in this browser');\n }\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n resolve({\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n accuracy: position.coords.accuracy,\n altitude: position.coords.altitude || undefined,\n bearing: position.coords.heading || undefined,\n speed: position.coords.speed || undefined,\n timestamp: new Date(position.timestamp).toISOString(),\n });\n },\n (error) => {\n let errorMessage = 'Location error';\n switch (error.code) {\n case error.PERMISSION_DENIED:\n errorMessage = 'Location permission denied';\n break;\n case error.POSITION_UNAVAILABLE:\n errorMessage = 'Location position unavailable';\n break;\n case error.TIMEOUT:\n errorMessage = 'Location request timed out';\n break;\n default:\n errorMessage = `Location error: ${error.message}`;\n break;\n }\n reject(errorMessage);\n },\n {\n enableHighAccuracy: true,\n timeout: 10000,\n maximumAge: 300000,\n }\n );\n });\n }\n\n async updateLocationSettings(): Promise<void> {\n throw this.unimplemented('Location service settings not supported on web.');\n }\n\n async getApiServiceStatus(): Promise<ApiServiceStatus> {\n throw this.unimplemented('API service not supported on web.');\n }\n\n async clearApiBuffers(): Promise<void> {\n throw this.unimplemented('API service not supported on web.');\n }\n\n async resetApiCircuitBreaker(): Promise<void> {\n throw this.unimplemented('API service not supported on web.');\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAElD,KAAK,CAAC,gBAAgB;QACpB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;YACpC,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1B,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;SACzE;QAED,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YAC1B,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;SACzE;QAED,IAAI;YACF,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,aAA+B,EAAE,CAAC,CAAC;YAChG,OAAO;gBACL,QAAQ,EAAE,UAAU,CAAC,KAAY;gBACjC,kBAAkB,EAAE,QAAQ;gBAC5B,aAAa,EAAE,QAAQ;aACxB,CAAC;SACH;QA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,CAAC,sBAAsB;QAC1B,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IAChE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ForeGroundLocationPlugin,\n LocationPermissionStatus,\n LocationResult,\n ApiServiceStatus\n} from './definitions';\n\nexport class ForeGroundLocationWeb extends WebPlugin implements ForeGroundLocationPlugin {\n\n async checkPermissions(): Promise<LocationPermissionStatus> {\n if (typeof navigator === 'undefined') {\n throw this.unavailable('Navigator not available');\n }\n\n if (!navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n\n if (!navigator.geolocation) {\n throw this.unavailable('Geolocation API not available in this browser');\n }\n\n try {\n const permission = await navigator.permissions.query({ name: 'geolocation' as PermissionName });\n return {\n location: permission.state as any,\n backgroundLocation: 'denied',\n notifications: 'denied'\n };\n } catch (error) {\n // Fallback for browsers that support geolocation but not permissions query\n return {\n location: 'prompt',\n backgroundLocation: 'denied',\n notifications: 'denied'\n };\n }\n }\n\n async requestPermissions(): Promise<LocationPermissionStatus> {\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\n }\n\n async checkBatteryOptimization(): Promise<{ isIgnoringBatteryOptimizations: boolean }> {\n return { isIgnoringBatteryOptimizations: true };\n }\n\n async requestBatteryOptimizationIgnore(): Promise<void> {\n console.warn('Battery optimization is not applicable on web');\n return;\n }\n\n async startForegroundLocationService(): Promise<void> {\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\n }\n\n async stopForegroundLocationService(): Promise<void> {\n throw this.unimplemented('Foreground location service not supported on web.');\n }\n\n async isServiceRunning(): Promise<{ isRunning: boolean }> {\n return { isRunning: false };\n }\n\n async getCurrentLocation(): Promise<LocationResult> {\n if (typeof navigator === 'undefined') {\n throw this.unavailable('Navigator not available');\n }\n\n if (!navigator.geolocation) {\n throw this.unavailable('Geolocation API not available in this browser');\n }\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n resolve({\n latitude: position.coords.latitude,\n longitude: position.coords.longitude,\n accuracy: position.coords.accuracy,\n altitude: position.coords.altitude || undefined,\n bearing: position.coords.heading || undefined,\n speed: position.coords.speed || undefined,\n timestamp: new Date(position.timestamp).toISOString(),\n });\n },\n (error) => {\n let errorMessage = 'Location error';\n switch (error.code) {\n case error.PERMISSION_DENIED:\n errorMessage = 'Location permission denied';\n break;\n case error.POSITION_UNAVAILABLE:\n errorMessage = 'Location position unavailable';\n break;\n case error.TIMEOUT:\n errorMessage = 'Location request timed out';\n break;\n default:\n errorMessage = `Location error: ${error.message}`;\n break;\n }\n reject(errorMessage);\n },\n {\n enableHighAccuracy: true,\n timeout: 10000,\n maximumAge: 300000,\n }\n );\n });\n }\n\n async updateLocationSettings(): Promise<void> {\n throw this.unimplemented('Location service settings not supported on web.');\n }\n\n async getApiServiceStatus(): Promise<ApiServiceStatus> {\n throw this.unimplemented('API service not supported on web.');\n }\n\n async clearApiBuffers(): Promise<void> {\n throw this.unimplemented('API service not supported on web.');\n }\n\n async resetApiCircuitBreaker(): Promise<void> {\n throw this.unimplemented('API service not supported on web.');\n }\n}\n"]}
@@ -63,6 +63,13 @@ class ForeGroundLocationWeb extends core.WebPlugin {
63
63
  async requestPermissions() {
64
64
  throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');
65
65
  }
66
+ async checkBatteryOptimization() {
67
+ return { isIgnoringBatteryOptimizations: true };
68
+ }
69
+ async requestBatteryOptimizationIgnore() {
70
+ console.warn('Battery optimization is not applicable on web');
71
+ return;
72
+ }
66
73
  async startForegroundLocationService() {
67
74
  throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');
68
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\r\n * Plugin error codes for consistent error handling\r\n */\r\nexport const ERROR_CODES = {\r\n /**\r\n * Location permission denied or not granted\r\n */\r\n PERMISSION_DENIED: 'PERMISSION_DENIED',\r\n /**\r\n * Invalid notification configuration\r\n */\r\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\r\n /**\r\n * Invalid parameters provided\r\n */\r\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\r\n /**\r\n * Location services disabled\r\n */\r\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\r\n /**\r\n * Feature not supported on current platform\r\n */\r\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\r\n};\r\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\r\nconst ForeGroundLocation = registerPlugin('ForeGroundLocation', {\r\n web: () => import('./web').then((m) => new m.ForeGroundLocationWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { ForeGroundLocation };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nexport class ForeGroundLocationWeb extends WebPlugin {\r\n async checkPermissions() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.permissions) {\r\n throw this.unavailable('Permissions API not available in this browser');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n try {\r\n const permission = await navigator.permissions.query({ name: 'geolocation' });\r\n return {\r\n location: permission.state,\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n catch (error) {\r\n // Fallback for browsers that support geolocation but not permissions query\r\n return {\r\n location: 'prompt',\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n }\r\n async requestPermissions() {\r\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async startForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async stopForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web.');\r\n }\r\n async isServiceRunning() {\r\n return { isRunning: false };\r\n }\r\n async getCurrentLocation() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n return new Promise((resolve, reject) => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n resolve({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n accuracy: position.coords.accuracy,\r\n altitude: position.coords.altitude || undefined,\r\n bearing: position.coords.heading || undefined,\r\n speed: position.coords.speed || undefined,\r\n timestamp: new Date(position.timestamp).toISOString(),\r\n });\r\n }, (error) => {\r\n let errorMessage = 'Location error';\r\n switch (error.code) {\r\n case error.PERMISSION_DENIED:\r\n errorMessage = 'Location permission denied';\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n errorMessage = 'Location position unavailable';\r\n break;\r\n case error.TIMEOUT:\r\n errorMessage = 'Location request timed out';\r\n break;\r\n default:\r\n errorMessage = `Location error: ${error.message}`;\r\n break;\r\n }\r\n reject(errorMessage);\r\n }, {\r\n enableHighAccuracy: true,\r\n timeout: 10000,\r\n maximumAge: 300000,\r\n });\r\n });\r\n }\r\n async updateLocationSettings() {\r\n throw this.unimplemented('Location service settings not supported on web.');\r\n }\r\n async getApiServiceStatus() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async clearApiBuffers() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async resetApiCircuitBreaker() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACY,MAAC,WAAW,GAAG;AAC3B;AACA;AACA;AACA,IAAI,iBAAiB,EAAE,mBAAmB;AAC1C;AACA;AACA;AACA,IAAI,oBAAoB,EAAE,sBAAsB;AAChD;AACA;AACA;AACA,IAAI,kBAAkB,EAAE,oB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CAAC,CAAC;AACtE,KAAK;AACL,IAAI,MAAM,sBAAsB,GAAG;AACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;AACtE,KAAK;AACL;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\r\n * Plugin error codes for consistent error handling\r\n */\r\nexport const ERROR_CODES = {\r\n /**\r\n * Location permission denied or not granted\r\n */\r\n PERMISSION_DENIED: 'PERMISSION_DENIED',\r\n /**\r\n * Invalid notification configuration\r\n */\r\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\r\n /**\r\n * Invalid parameters provided\r\n */\r\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\r\n /**\r\n * Location services disabled\r\n */\r\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\r\n /**\r\n * Feature not supported on current platform\r\n */\r\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\r\n};\r\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\r\nconst ForeGroundLocation = registerPlugin('ForeGroundLocation', {\r\n web: () => import('./web').then((m) => new m.ForeGroundLocationWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { ForeGroundLocation };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nexport class ForeGroundLocationWeb extends WebPlugin {\r\n async checkPermissions() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.permissions) {\r\n throw this.unavailable('Permissions API not available in this browser');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n try {\r\n const permission = await navigator.permissions.query({ name: 'geolocation' });\r\n return {\r\n location: permission.state,\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n catch (error) {\r\n // Fallback for browsers that support geolocation but not permissions query\r\n return {\r\n location: 'prompt',\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n }\r\n async requestPermissions() {\r\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async checkBatteryOptimization() {\r\n return { isIgnoringBatteryOptimizations: true };\r\n }\r\n async requestBatteryOptimizationIgnore() {\r\n console.warn('Battery optimization is not applicable on web');\r\n return;\r\n }\r\n async startForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async stopForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web.');\r\n }\r\n async isServiceRunning() {\r\n return { isRunning: false };\r\n }\r\n async getCurrentLocation() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n return new Promise((resolve, reject) => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n resolve({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n accuracy: position.coords.accuracy,\r\n altitude: position.coords.altitude || undefined,\r\n bearing: position.coords.heading || undefined,\r\n speed: position.coords.speed || undefined,\r\n timestamp: new Date(position.timestamp).toISOString(),\r\n });\r\n }, (error) => {\r\n let errorMessage = 'Location error';\r\n switch (error.code) {\r\n case error.PERMISSION_DENIED:\r\n errorMessage = 'Location permission denied';\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n errorMessage = 'Location position unavailable';\r\n break;\r\n case error.TIMEOUT:\r\n errorMessage = 'Location request timed out';\r\n break;\r\n default:\r\n errorMessage = `Location error: ${error.message}`;\r\n break;\r\n }\r\n reject(errorMessage);\r\n }, {\r\n enableHighAccuracy: true,\r\n timeout: 10000,\r\n maximumAge: 300000,\r\n });\r\n });\r\n }\r\n async updateLocationSettings() {\r\n throw this.unimplemented('Location service settings not supported on web.');\r\n }\r\n async getApiServiceStatus() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async clearApiBuffers() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async resetApiCircuitBreaker() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACY,MAAC,WAAW,GAAG;AAC3B;AACA;AACA;AACA,IAAI,iBAAiB,EAAE,mBAAmB;AAC1C;AACA;AACA;AACA,IAAI,oBAAoB,EAAE,sBAAsB;AAChD;AACA;AACA;AACA,IAAI,kBAAkB,EAAE,oBAAoB;AAC5C;AACA;AACA;AACA,IAAI,0BAA0B,EAAE,4BAA4B;AAC5D;AACA;AACA;AACA,IAAI,oBAAoB,EAAE,sBAAsB;AAChD;;ACvBK,MAAC,kBAAkB,GAAGA,mBAAc,CAAC,oBAAoB,EAAE;AAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACzE,CAAC;;ACFM,MAAM,qBAAqB,SAASC,cAAS,CAAC;AACrD,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;AAC9C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;AAC9D,SAAS;AACT,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;AACpC,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;AACpF,SAAS;AACT,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;AACpC,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;AACpF,SAAS;AACT,QAAQ,IAAI;AACZ,YAAY,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,WAAW,CAAC,KAAK,CAA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wB,YAAY,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1E,wBAAwB,MAAM;AAC9B,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,aAAa,EAAE;AACf,gBAAgB,kBAAkB,EAAE,IAAI;AACxC,gBAAgB,OAAO,EAAE,KAAK;AAC9B,gBAAgB,UAAU,EAAE,MAAM;AAClC,aAAa,CAAC,CAAC;AACf,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,MAAM,sBAAsB,GAAG;AACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;AACpF,KAAK;AACL,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;AACtE,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;AACtE,KAAK;AACL,IAAI,MAAM,sBAAsB,GAAG;AACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;AACtE,KAAK;AACL;;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -62,6 +62,13 @@ var capacitorForeGroundLocation = (function (exports, core) {
62
62
  async requestPermissions() {
63
63
  throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');
64
64
  }
65
+ async checkBatteryOptimization() {
66
+ return { isIgnoringBatteryOptimizations: true };
67
+ }
68
+ async requestBatteryOptimizationIgnore() {
69
+ console.warn('Battery optimization is not applicable on web');
70
+ return;
71
+ }
65
72
  async startForegroundLocationService() {
66
73
  throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');
67
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\r\n * Plugin error codes for consistent error handling\r\n */\r\nexport const ERROR_CODES = {\r\n /**\r\n * Location permission denied or not granted\r\n */\r\n PERMISSION_DENIED: 'PERMISSION_DENIED',\r\n /**\r\n * Invalid notification configuration\r\n */\r\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\r\n /**\r\n * Invalid parameters provided\r\n */\r\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\r\n /**\r\n * Location services disabled\r\n */\r\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\r\n /**\r\n * Feature not supported on current platform\r\n */\r\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\r\n};\r\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\r\nconst ForeGroundLocation = registerPlugin('ForeGroundLocation', {\r\n web: () => import('./web').then((m) => new m.ForeGroundLocationWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { ForeGroundLocation };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nexport class ForeGroundLocationWeb extends WebPlugin {\r\n async checkPermissions() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.permissions) {\r\n throw this.unavailable('Permissions API not available in this browser');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n try {\r\n const permission = await navigator.permissions.query({ name: 'geolocation' });\r\n return {\r\n location: permission.state,\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n catch (error) {\r\n // Fallback for browsers that support geolocation but not permissions query\r\n return {\r\n location: 'prompt',\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n }\r\n async requestPermissions() {\r\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async startForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async stopForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web.');\r\n }\r\n async isServiceRunning() {\r\n return { isRunning: false };\r\n }\r\n async getCurrentLocation() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n return new Promise((resolve, reject) => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n resolve({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n accuracy: position.coords.accuracy,\r\n altitude: position.coords.altitude || undefined,\r\n bearing: position.coords.heading || undefined,\r\n speed: position.coords.speed || undefined,\r\n timestamp: new Date(position.timestamp).toISOString(),\r\n });\r\n }, (error) => {\r\n let errorMessage = 'Location error';\r\n switch (error.code) {\r\n case error.PERMISSION_DENIED:\r\n errorMessage = 'Location permission denied';\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n errorMessage = 'Location position unavailable';\r\n break;\r\n case error.TIMEOUT:\r\n errorMessage = 'Location request timed out';\r\n break;\r\n default:\r\n errorMessage = `Location error: ${error.message}`;\r\n break;\r\n }\r\n reject(errorMessage);\r\n }, {\r\n enableHighAccuracy: true,\r\n timeout: 10000,\r\n maximumAge: 300000,\r\n });\r\n });\r\n }\r\n async updateLocationSettings() {\r\n throw this.unimplemented('Location service settings not supported on web.');\r\n }\r\n async getApiServiceStatus() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async clearApiBuffers() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async resetApiCircuitBreaker() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACY,UAAC,WAAW,GAAG;IAC3B;IACA;IACA;IACA,IAAI,iBAAiB,EAAE,mBAAmB;IAC1C;IACA;IACA;IACA,IAAI,oBAAoB,EAAE,sBA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B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IACtE,KAAK;IACL,IAAI,MAAM,sBAAsB,GAAG;IACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IACtE,KAAK;IACL;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\r\n * Plugin error codes for consistent error handling\r\n */\r\nexport const ERROR_CODES = {\r\n /**\r\n * Location permission denied or not granted\r\n */\r\n PERMISSION_DENIED: 'PERMISSION_DENIED',\r\n /**\r\n * Invalid notification configuration\r\n */\r\n INVALID_NOTIFICATION: 'INVALID_NOTIFICATION',\r\n /**\r\n * Invalid parameters provided\r\n */\r\n INVALID_PARAMETERS: 'INVALID_PARAMETERS',\r\n /**\r\n * Location services disabled\r\n */\r\n LOCATION_SERVICES_DISABLED: 'LOCATION_SERVICES_DISABLED',\r\n /**\r\n * Feature not supported on current platform\r\n */\r\n UNSUPPORTED_PLATFORM: 'UNSUPPORTED_PLATFORM'\r\n};\r\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\r\nconst ForeGroundLocation = registerPlugin('ForeGroundLocation', {\r\n web: () => import('./web').then((m) => new m.ForeGroundLocationWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { ForeGroundLocation };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nexport class ForeGroundLocationWeb extends WebPlugin {\r\n async checkPermissions() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.permissions) {\r\n throw this.unavailable('Permissions API not available in this browser');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n try {\r\n const permission = await navigator.permissions.query({ name: 'geolocation' });\r\n return {\r\n location: permission.state,\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n catch (error) {\r\n // Fallback for browsers that support geolocation but not permissions query\r\n return {\r\n location: 'prompt',\r\n backgroundLocation: 'denied',\r\n notifications: 'denied'\r\n };\r\n }\r\n }\r\n async requestPermissions() {\r\n throw this.unimplemented('Background location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async checkBatteryOptimization() {\r\n return { isIgnoringBatteryOptimizations: true };\r\n }\r\n async requestBatteryOptimizationIgnore() {\r\n console.warn('Battery optimization is not applicable on web');\r\n return;\r\n }\r\n async startForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web. Use getCurrentLocation() for one-time location access.');\r\n }\r\n async stopForegroundLocationService() {\r\n throw this.unimplemented('Foreground location service not supported on web.');\r\n }\r\n async isServiceRunning() {\r\n return { isRunning: false };\r\n }\r\n async getCurrentLocation() {\r\n if (typeof navigator === 'undefined') {\r\n throw this.unavailable('Navigator not available');\r\n }\r\n if (!navigator.geolocation) {\r\n throw this.unavailable('Geolocation API not available in this browser');\r\n }\r\n return new Promise((resolve, reject) => {\r\n navigator.geolocation.getCurrentPosition((position) => {\r\n resolve({\r\n latitude: position.coords.latitude,\r\n longitude: position.coords.longitude,\r\n accuracy: position.coords.accuracy,\r\n altitude: position.coords.altitude || undefined,\r\n bearing: position.coords.heading || undefined,\r\n speed: position.coords.speed || undefined,\r\n timestamp: new Date(position.timestamp).toISOString(),\r\n });\r\n }, (error) => {\r\n let errorMessage = 'Location error';\r\n switch (error.code) {\r\n case error.PERMISSION_DENIED:\r\n errorMessage = 'Location permission denied';\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n errorMessage = 'Location position unavailable';\r\n break;\r\n case error.TIMEOUT:\r\n errorMessage = 'Location request timed out';\r\n break;\r\n default:\r\n errorMessage = `Location error: ${error.message}`;\r\n break;\r\n }\r\n reject(errorMessage);\r\n }, {\r\n enableHighAccuracy: true,\r\n timeout: 10000,\r\n maximumAge: 300000,\r\n });\r\n });\r\n }\r\n async updateLocationSettings() {\r\n throw this.unimplemented('Location service settings not supported on web.');\r\n }\r\n async getApiServiceStatus() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async clearApiBuffers() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n async resetApiCircuitBreaker() {\r\n throw this.unimplemented('API service not supported on web.');\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACY,UAAC,WAAW,GAAG;IAC3B;IACA;IACA;IACA,IAAI,iBAAiB,EAAE,mBAAmB;IAC1C;IACA;IACA;IACA,IAAI,oBAAoB,EAAE,sBAAsB;IAChD;IACA;IACA;IACA,IAAI,kBAAkB,EAAE,oBAAoB;IAC5C;IACA;IACA;IACA,IAAI,0BAA0B,EAAE,4BAA4B;IAC5D;IACA;IACA;IACA,IAAI,oBAAoB,EAAE,sBAAsB;IAChD;;ACvBK,UAAC,kBAAkB,GAAGA,mBAAc,CAAC,oBAAoB,EAAE;IAChE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;IACzE,CAAC;;ICFM,MAAM,qBAAqB,SAASC,cAAS,CAAC;IACrD,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IAC9C,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;IAC9D,SAAS;IACT,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;IACpC,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACpF,SAAS;IACT,QAAQ,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;IACpC,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,+CAA+C,CAAC,CAAC;IACpF,SAAS;IACT,QAAQ,IAAI;IACZ,YAAY,MAAM,UA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C;IACpE,wBAAwB,MAAM;IAC9B,oBAAoB;IACpB,wBAAwB,YAAY,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E,wBAAwB,MAAM;IAC9B,iBAAiB;IACjB,gBAAgB,MAAM,CAAC,YAAY,CAAC,CAAC;IACrC,aAAa,EAAE;IACf,gBAAgB,kBAAkB,EAAE,IAAI;IACxC,gBAAgB,OAAO,EAAE,KAAK;IAC9B,gBAAgB,UAAU,EAAE,MAAM;IAClC,aAAa,CAAC,CAAC;IACf,SAAS,CAAC,CAAC;IACX,KAAK;IACL,IAAI,MAAM,sBAAsB,GAAG;IACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,iDAAiD,CAAC,CAAC;IACpF,KAAK;IACL,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IACtE,KAAK;IACL,IAAI,MAAM,eAAe,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IACtE,KAAK;IACL,IAAI,MAAM,sBAAsB,GAAG;IACnC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,mCAAmC,CAAC,CAAC;IACtE,KAAK;IACL;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foreground-location",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Location Tracking Using Foreground Service and Fused Location API",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",