Skip to content

Commit c78ce71

Browse files
authored
Merge pull request #1627 from transistorsoft/release-5.0.2
Release 5.0.2
2 parents a4bf4c6 + 403865a commit c78ce71

File tree

11 files changed

+66
-27
lines changed

11 files changed

+66
-27
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## 5.0.2 — 2026-01-28
4+
* [iOS] Fix bug in iOS License Validation Failure modal dialog interfering with React Native app launching. Change to less intrusive alert mechanism.
5+
* [iOS] Fix bug returning wrong data-structure to watchPosition callback.
6+
* [iOS] Fix first-launch issue with initial call to `.start()`..
7+
* [iOS] Fix config.authorization bug (refreshPayload and refreshHeaders being ignored).
8+
* [Android] Re-factor Android activity life-cycle management. It's all done internally within SDK now. No need for react-native plugin code to manually listen to Activity lifecycle and poke the SDK when interesting events happen.
9+
* Fix bug not respecting `PersistenceConfig.geofenceTemplate`
10+
* [iOS] Fix bug in `setOdometer` not resolving its `Promise`
11+
312
## 5.0.1 — 2026-01-14
413
* [iOS] Fix syntax error in `Package.swift`
514

android/src/main/java/com/transistorsoft/flutter/backgroundgeolocation/BackgroundGeolocationModule.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ void setActivity(@Nullable final Activity activity) {
151151
if (app != null) {
152152
app.unregisterActivityLifecycleCallbacks(this);
153153
}
154-
cancelStreamHandlersForAllMessengers();
155-
BackgroundGeolocation.getInstance(mContext).onActivityDestroy();
154+
cancelStreamHandlersForAllMessengers();
156155
}
157156
mActivity = activity;
158157
}
@@ -218,8 +217,10 @@ private void initializeLocationManager(Activity activity) {
218217
if (activity == null) {
219218
return;
220219
}
220+
final BackgroundGeolocation bgGeo = BackgroundGeolocation.getInstance(mContext);
221+
bgGeo.setActivity(activity);
221222
// Handle play-services connect errors.
222-
BackgroundGeolocation.getInstance(mContext).onPlayServicesConnectError((new TSPlayServicesConnectErrorCallback() {
223+
bgGeo.onPlayServicesConnectError((new TSPlayServicesConnectErrorCallback() {
223224
@Override
224225
public void onPlayServicesConnectError(int errorCode) {
225226
handlePlayServicesConnectError(errorCode);
@@ -347,7 +348,6 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result
347348
}
348349
}
349350

350-
// experimental Flutter Headless (NOT READY)
351351
private void registerHeadlessTask(List<Object> callbacks, MethodChannel.Result result) {
352352
if (HeadlessTask.register(mContext, callbacks)) {
353353
result.success(true);
@@ -1079,10 +1079,7 @@ public void onActivityPaused(Activity activity) {
10791079

10801080
@Override
10811081
public void onActivityResumed(@NonNull Activity activity) {
1082-
if (!activity.equals(mActivity)) {
1083-
return;
1084-
}
1085-
TSScheduleManager.getInstance(activity).cancelOneShot(TerminateEvent.ACTION);
1082+
10861083
}
10871084
@Override
10881085
public void onActivityStarted(Activity activity) {
@@ -1092,13 +1089,7 @@ public void onActivityStarted(Activity activity) {
10921089
}
10931090
@Override
10941091
public void onActivityStopped(@NonNull Activity activity) {
1095-
if (!activity.equals(mActivity)) {
1096-
return;
1097-
}
1098-
TSConfig config = TSConfig.getInstance(activity);
1099-
if (config.getEnabled()) {
1100-
TSScheduleManager.getInstance(activity).oneShot(TerminateEvent.ACTION, 10000, true, false);
1101-
}
1092+
11021093
}
11031094

11041095
@Override

example/android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ allprojects {
22
ext {
33
set("appCompatVersion", "1.4.2") // or higher / as desired
44
set("playServicesLocationVersion", "21.3.0") // or higher / as desired
5-
set("tslocationmanagerVersion", "4.0.0")
5+
set("tslocationmanagerVersion", "4.0.+")
66
set("compileSdkVersion", 35)
77
}
88
repositories {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</Testables>
7979
</TestAction>
8080
<LaunchAction
81-
buildConfiguration = "Debug"
81+
buildConfiguration = "Release"
8282
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
8383
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
8484
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"

example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner/AppDelegate.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Flutter
22
import UIKit
3-
import TSBackgroundFetch
43

54
@main
65
@objc class AppDelegate: FlutterAppDelegate {

example/lib/advanced/home_view.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ class HomeViewState extends State<HomeView> with TickerProviderStateMixin<HomeVi
670670
bg.BackgroundGeolocation.setOdometer(0.0).catchError((error) {
671671
print('************ dispose [setOdometer] ERROR $error');
672672
});
673-
674673
}
675674

676675
void _handleTabChange() async {

ios/flutter_background_geolocation.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
1919
s.public_header_files = 'flutter_background_geolocation/Sources/flutter_background_geolocation/include/**/*.h'
2020
s.dependency 'Flutter'
2121
s.dependency 'CocoaLumberjack', '~> 3.8.5'
22-
s.dependency 'TSLocationManager', '~> 4.0.0'
22+
s.dependency 'TSLocationManager', '~> 4.0.10'
2323

2424
s.libraries = 'sqlite3', 'z', 'stdc++'
2525
s.static_framework = true

ios/flutter_background_geolocation/Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/flutter_background_geolocation/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
],
1515
dependencies: [
1616
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack.git", from: "3.8.5"),
17-
.package(url: "https://github.com/transistorsoft/native-background-geolocation.git", from: "4.0.0"),
17+
.package(url: "https://github.com/transistorsoft/native-background-geolocation.git", from: "4.0.10"),
1818
.package(url: "https://github.com/transistorsoft/transistor-background-fetch.git", from: "4.0.5")
1919
],
2020
targets: [
@@ -35,4 +35,4 @@ let package = Package(
3535
]
3636
)
3737
]
38-
)
38+
)

0 commit comments

Comments
 (0)