Closed erayhamurlu closed 3 years ago
Ios or android ??
evet bendede bu hatayı veriyor W/FlutterJNI(30740): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: almoullim.com/background_location. Response ID: 0
Same issue. Not working when app killed. Android & Ios
If that helps, here's the console log when killing an app on the device (android 10.0):
E/ActivityThread(13770): Activity com.example.flutter_application_1.MainActivity has leaked ServiceConnection com.almoullim.background_location.BackgroundLocationPlugin$mServiceConnection$1@e72e099 that was originally bound here E/ActivityThread(13770): android.app.ServiceConnectionLeaked: Activity com.example.flutter_application_1.MainActivity has leaked ServiceConnection com.almoullim.background_location.BackgroundLocationPlugin$mServiceConnection$1@e72e099 that was originally bound here E/ActivityThread(13770): at android.app.LoadedApk$ServiceDispatcher.
(LoadedApk.java:1805) E/ActivityThread(13770): at android.app.LoadedApk.getServiceDispatcherCommon(LoadedApk.java:1677) E/ActivityThread(13770): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:1656) E/ActivityThread(13770): at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1721) E/ActivityThread(13770): at android.app.ContextImpl.bindService(ContextImpl.java:1650) E/ActivityThread(13770): at android.content.ContextWrapper.bindService(ContextWrapper.java:705) E/ActivityThread(13770): at com.almoullim.background_location.BackgroundLocationPlugin.onMethodCall(BackgroundLocationPlugin.kt:82) E/ActivityThread(13770): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233) E/ActivityThread(13770): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/ActivityThread(13770): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) E/ActivityThread(13770): at android.os.MessageQueue.nativePollOnce(Native Method) E/ActivityThread(13770): at android.os.MessageQueue.next(MessageQueue.java:336) E/ActivityThread(13770): at android.os.Looper.loop(Looper.java:174) E/ActivityThread(13770): at android.app.ActivityThread.main(ActivityThread.java:7356) E/ActivityThread(13770): at java.lang.reflect.Method.invoke(Native Method) E/ActivityThread(13770): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E/ActivityThread(13770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Anyone found a solution ?
I don't believe there are currently any ways for a native iOS or Android app to get the users location after it has been quit or fully closed by the user. Flutter is not able to do anything more than can be done natively in Android and iOS, so I don't believe this is ever going to be possible.
iOS Apps and Android Apps definitely Get locations after being terminated. There are APIs for that case. I ended up using a different pub and made sure the system specific APIs work led correctly
iOS Apps and Android Apps definitely Get locations after being terminated
Do you have links to where this is in the documentation? id love to learn how to do this too!
same for me here, I'm trying to get the user's location even when the app is killed, has someone managed to do this?
I have worked on native iOS apps that constantly supply locations in the background. The difference is, in the background/terminated state, we have to manually stop listening to locationUpdates, and start listening to significantLocationChanges. These will only trigger when the user moves approx. 500m. but it does the job with low battery consumption.
@schnphil Could you tell me what pub you ended up using? I have a similar problem.
evet bendede bu hatayı veriyor W/FlutterJNI(30740): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: almoullim.com/background_location. Response ID: 0
IOS arka planda app kill iken konum alıp server a istek atma işlemini yapabildiniz mi?
not work when app killed