@capacitor-community/background-geolocation
Advanced tools
@@ -289,2 +289,3 @@ package com.equimaps.capacitor_background_geolocation; | ||
| Intent serviceIntent = new Intent(this.getContext(), BackgroundGeolocationService.class); | ||
| // Android O requires a Notification Channel. | ||
@@ -307,6 +308,9 @@ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| manager.createNotificationChannel(channel); | ||
| this.getContext().startForegroundService(serviceIntent); | ||
| } else { | ||
| this.getContext().startService(serviceIntent); | ||
| } | ||
| this.getContext().bindService( | ||
| new Intent(this.getContext(), BackgroundGeolocationService.class), | ||
| serviceIntent, | ||
| new ServiceConnection() { | ||
@@ -313,0 +317,0 @@ @Override |
@@ -46,2 +46,7 @@ package com.equimaps.capacitor_background_geolocation; | ||
| @Override | ||
| public int onStartCommand(Intent intent, int flags, int startId) { | ||
| return START_STICKY; | ||
| } | ||
| @Override | ||
| public IBinder onBind(Intent intent) { | ||
@@ -48,0 +53,0 @@ return binder; |
+1
-1
| { | ||
| "name": "@capacitor-community/background-geolocation", | ||
| "version": "1.2.22", | ||
| "version": "1.2.23", | ||
| "description": "Receive geolocation updates even while the app is in the background.", | ||
@@ -5,0 +5,0 @@ "repository": { |
+11
-0
@@ -191,2 +191,10 @@ # Background Geolocation | ||
| creating the image asset in Android Studio. | ||
| An incompatible image asset will cause the notification to misbehave in | ||
| a few telling ways, even if the icon appears correctly: | ||
| - The notification may be dismissable by the user when it should not | ||
| be. | ||
| - Tapping the notification may open the settings, not the app. | ||
| - The notification text may be incorrect. | ||
| --> | ||
@@ -210,2 +218,5 @@ <string name="capacitor_background_geolocation_notification_icon"> | ||
| ### v1.2.23 | ||
| - Perhaps make location updates more persistent on Android, see #137. | ||
| ### v1.2.22 | ||
@@ -212,0 +223,0 @@ - Avoid interfering with safe area insets on Android |
49370
1.57%521
1.56%261
4.4%