Skip to content

Commit

Permalink
Removes RadarForegroundService and adds support for Coarse location (#28
Browse files Browse the repository at this point in the history
)

* remove RadarForegroundService and add COARSE to the permissions request

* bump to 3.1.5

* Changelog entry for foreground service changes
  • Loading branch information
tjulien authored Jan 31, 2023
1 parent abf7a6e commit e472518
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 105 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 3.1.5

- `startForegroundService` and `stopForegroundService` are no longer available. This has been replaced by `Radar.setForegroundServiceOptions` instead.

For example:
```
Radar.setForegroundServiceOptions({
'title': 'Tracking',
'text': 'Trip tracking started',
'icon': 2131165271,
'importance': 2,
'updatesOnly': false,
'activity': 'io.radar.example.MainActivity'
});
```

# 3.1.4

- Exposes `setForegroundServiceOptions` and fixes android receiver implementation.
Expand Down
3 changes: 0 additions & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.radar.flutter">
<application>
<service android:name="io.radar.flutter.RadarForegroundService" android:foregroundServiceType="location" android:stopWithTask="true" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ private void requestPermissions(MethodCall call, Result result) {
if (mActivity != null) {
if (Build.VERSION.SDK_INT >= 23) {
if (background && Build.VERSION.SDK_INT >= 29) {
ActivityCompat.requestPermissions(mActivity, new String[] { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION }, PERMISSIONS_REQUEST_CODE);
ActivityCompat.requestPermissions(mActivity, new String[] { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION }, PERMISSIONS_REQUEST_CODE);
} else {
ActivityCompat.requestPermissions(mActivity, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, PERMISSIONS_REQUEST_CODE);
ActivityCompat.requestPermissions(mActivity, new String[] { Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION }, PERMISSIONS_REQUEST_CODE);
}
}
}
Expand Down
98 changes: 0 additions & 98 deletions android/src/main/java/io/radar/flutter/RadarForegroundService.java

This file was deleted.

2 changes: 1 addition & 1 deletion ios/flutter_radar.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'flutter_radar'
s.version = '3.1.4'
s.version = '3.1.5'
s.summary = 'Flutter package for Radar, the leading geofencing and location tracking platform'
s.description = 'Flutter package for Radar, the leading geofencing and location tracking platform'
s.homepage = 'http://example.com'
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_radar
description: Flutter package for Radar, the leading geofencing and location tracking platform
version: 3.1.4
version: 3.1.5
homepage: https://github.com/radarlabs/flutter-radar

environment:
Expand Down

0 comments on commit e472518

Please sign in to comment.