-
Notifications
You must be signed in to change notification settings - Fork 231
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
headless with state management or providers #167
Comments
Don't do this:
|
And also make sure your 📂 // Headless function defined "in top level"
void headlessTask(bg.HeadlessEvent event) async {
print('headlessTask');
}
void main() {
runApp(YourApp());
// Headless function registered within main()
bg.BackgroundGeolocation.registerHeadlessTask(headlessTask);
} |
@christocracy thanks for reply , and Happy new year, main.dart
home.dart
onLocation helper
the error is
I recored my test maybe there is something weird I'm wrong with. |
I'm trying also remove my own headless task handle and depended on your package handle it's work also when app is opening but after terminated it i hear the debug sound but my app doesn't live don't give me any notification like when he open |
It makes me angry when people flood the thread with logs. I’m not looking at any of that or anything else in this thread until you clean that up. |
any handle code by me inside it's give me
|
Have you Upgraded your Flutter Android Project? |
no , i didn't upgrade yet ! |
I strongly suggest you do so. Flutter has completely refactored their "headless" mechanism. You no longer need to do any extra steps in a custom |
I did it but now all issues that occurred when background_featch happened when app lunch I check every dependences now and after make app work as expected I will test your package point , sorry for any abuse |
I'm facing a same issue background don't hear after terminated app I have used
MainActivity.kt is
my main.dart
my flutter --version
when app is opened it's receives and handle very well but after app terminated not receives any background calls |
final I have received background call after create new project only with java and move my code to new project but I can't access on any package like sqflite gives me
and when try open database before query to ensure the database is not null gives
SharedPreferences gives me
|
Could you please generate a simple hello-world project and share the github repo with me. |
I create new app just with your package and it's working as good , so I think this issue is conflict with other package so i have added one by one and I think I have figure out what package is make this issue that called this is a project link in github please check it due to I can't test backend fetch as good as I think |
is there any way to handle data from sqflite not SharedPreferences, sqflite not work in backend fetch. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open. |
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you. |
Hi people! |
transistorsoft/flutter_background_fetch#283 |
Your Environment
flutter doctor
):Expected Behavior
I'm trying to use headless in android it's work great but I need use Providers or state management with it to check my location in database but I can't figure out what the way once give me
and once give me
Context
in main.dart
main Function once
and I'm tried in myApp() function
The text was updated successfully, but these errors were encountered: