-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about initCallback and initDataCallback #227
Comments
Hi @TheSuperiorStanislav Yes, that was intentional. Every function ( About |
@mehdok Thank you for responding. I have a few questions IsolateHolderService.setPluginRegistrant(this) On ios sometimes logger shows. The locator works, but is it something I should be worried about? [....] Disconnected 7c593290f7aaea8c417705af92c4baafc18e3b47 From time to time the whole app crashes with this exception when I starting the locator. It's like one time okay, the other not. (On android 11(simulator) and 9(device)) E/AndroidRuntime(13499): java.lang.RuntimeException: Unable to start service rekab.app.background_locator.IsolateHolderService@601cf53 with Intent { act=SHUTDOWN cmp=com.saritasa.workapp.dev/rekab.app.background_locator.IsolateHolderService }: kotlin.UninitializedPropertyAccessException: lateinit property locatorClient has not been initialized
E/AndroidRuntime(13499): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4319)
E/AndroidRuntime(13499): at android.app.ActivityThread.access$2700(ActivityThread.java:273)
E/AndroidRuntime(13499): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2070)
E/AndroidRuntime(13499): at android.os.Handler.dispatchMessage(Handler.java:112)
E/AndroidRuntime(13499): at android.os.Looper.loop(Looper.java:216)
E/AndroidRuntime(13499): at android.app.ActivityThread.main(ActivityThread.java:7625)
E/AndroidRuntime(13499): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(13499): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/AndroidRuntime(13499): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
E/AndroidRuntime(13499): Caused by: kotlin.UninitializedPropertyAccessException: lateinit property locatorClient has not been initialized
E/AndroidRuntime(13499): at rekab.app.background_locator.IsolateHolderService.shutdownHolderService(IsolateHolderService.kt:161)
E/AndroidRuntime(13499): at rekab.app.background_locator.IsolateHolderService.onStartCommand(IsolateHolderService.kt:117)
E/AndroidRuntime(13499): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4298)
E/AndroidRuntime(13499): ... 8 more |
Hi, I am passing a variable (firebase uid) to my isolate on initDataCallback, everything works fine before. But now that the initDataCallback is removed, how do I pass my variable? Looking forward for your help. Example code is also not updated. Thank you. |
Hello @mehdok I didn't quite understood your explanation, thoses init parameters are a way to set things up in the isolate, for example I use initData to send the app Documents path, and initCallback to create a File instance which can then be written the newly received locations. I remember we were having a conversation about the way memory gets separated when stuff is in isolate and you didn't undertstood the concept ; This is the only library that offer a callback ran in the background's own thread, initData and init Callback were the cherry on top. I would be really happy if you could bring those functions again |
Thank you for your patient. |
Hi @allanguintu Please save your |
Hi @RomanJos I understand your concern and I remember our conversation about this, but there is a simpler option for this, Using |
lol yeah I was away from coding a little bit 😅 Concerning this issue, if I understand correctly, in my case I need to check on every callback if my File Instance from the isolate isn't null to set it by reading The current way to spawn an isolate in dart is limited to only one argument so initDataCallback made sense for me, its weird to save variable to a file instead of passing it as argument |
Awesome !! |
In version
1.6.0+1-beta
,initCallback
andinitDataCallback
were removed. Is it intentional? If so what is replacement(probably wiki should be updated)The text was updated successfully, but these errors were encountered: