background_locator
background_locator copied to clipboard
Does someone also face crash issue when running on Android OS 8?
Does someone also face crash issue when running on Android OS 8? I get crash when run on Android OS 8.
Hi @function2000 Thank you for opening an issue;
What kind of issue do you have with Android 8?
Hi @function2000 Thank you for opening an issue;
What kind of issue do you have with Android 8?
When asked for permission, click allow, then it crashed,and then app cannot be open again. That is the reason I asked if somebody else face the same issue.
Hi @function2000 Thank you for opening an issue;
What kind of issue do you have with Android 8?
Please see below screenshot, maybe you can also have a try on Android 8 device:
@mehdok any solution to make it work on Android 8? Thanks!
@function2000 Please show me some code;
@function2000 Please show me some code;
Sorry for late reply, here below are some code. I don't think it is my code issue, perhaps you try run on Android 8, you will see the same problem.
================================> void _startLocator() { Map<String, dynamic> data = {'countInit': 1}; BackgroundLocator.registerLocationUpdate(LocationCallbackHandler.callback, initCallback: LocationCallbackHandler.initCallback, initDataCallback: data, /* Comment initDataCallback, so service not set init variable, variable stay with value of last run after unRegisterLocationUpdate */ disposeCallback: LocationCallbackHandler.disposeCallback, iosSettings: IOSSettings( accuracy: LocationAccuracy.NAVIGATION, distanceFilter: 0), autoStop: false, androidSettings: AndroidSettings( accuracy: LocationAccuracy.BALANCED, interval: 60, //1 minute wakeLockTime:1440, //24hours distanceFilter: 0, client: LocationClient.android, androidNotificationSettings: AndroidNotificationSettings( notificationChannelName: 'nxxii_gps_bg', notificationTitle: 'Running in background', notificationMsg: 'Updating...', notificationBigMsg: 'Updating...', notificationIcon: '', notificationIconColor: Colors.grey, notificationTapCallback: LocationCallbackHandler.notificationCallback) )); }
................
void _onStart() async { if (await _checkLocationPermission()) { _startLocator(); final _isRunning = await BackgroundLocator.isServiceRunning();
setState(() {
isRunning = _isRunning;
lastTimeLocation = null;
lastLocation = null;
});
} else {
// show error
}
}
............................................. void initGeoLocator(){
if (IsolateNameServer.lookupPortByName(
_isolateName) !=
null) {
IsolateNameServer.removePortNameMapping(
_isolateName);
}
IsolateNameServer.registerPortWithName(
port.sendPort, _isolateName);
port.listen(
(dynamic data) async {
lastLocation = data;
positions.add(data);
},
);
initGeoPlatformState();
_onStart();
}
android 8.1
@function2000 请给我看一些代码;
android 8.1 I have the same problem,Brand is the oppo