Skip to content

Commit 88d0d6f

Browse files
committed
Manually register service so we can set the foregroundServiceType
Fix refresh icon displaying on start up
1 parent 4c926dc commit 88d0d6f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Tracked.Android/Location/LocationService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
using Android.Content;
44
using Android.Locations;
55
using Android.OS;
6+
using Android.Runtime;
67
using Android.Support.V4.App;
78
using Shared.Dtos;
89

910
namespace Tracked.Droid.Location {
10-
[Service(Enabled = true)]
11+
[Register("com.samorme.tracked.LocationService")]
1112
public class LocationService : Service, ILocationListener {
1213
private const string channelId = "default";
1314
public static string MainActivityAction = "OpenedFromLocationServiceNotification";
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="9" android:versionName="1.3.5" package="com.samorme.tracked" android:installLocation="internalOnly">
3-
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30" />
4-
<application />
3+
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30" />
4+
<application>
5+
<service android:enabled="true" android:foregroundServiceType="location" android:exported="false" android:name="com.samorme.tracked.LocationService" />
6+
</application>
57
</manifest>

src/Tracked/Screens/Home/MainPageViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public bool IsUploading {
4343
OnPropertyChanged(nameof(UploadText));
4444
OnPropertyChanged(nameof(ShowUploadCount));
4545
OnPropertyChanged(nameof(PendingUploudCount));
46+
OnPropertyChanged(nameof(IsRefreshing));
4647
}
4748
}
4849
}

0 commit comments

Comments
 (0)