michael-cheung-thebus / foreground_service Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
In flutter 1.12 GeneratedPluginRegistrant.registerWith(p0)
method returns an error:
Type mismatch: inferred type is PluginRegistry? but FlutterEngine was expected
How can this conflict be resolved in the new version?
Hello!
I have issue, when re-run the function with new account without close and open the app, the foreground will call old data, even the data was change by user;
exmaple :
String data = "1"
then print(data) will show "1";
String data = "2"
then print(data) will show "1" again;
can I stop the foreground and clear all config?
blob:https://carbon.now.sh/8dde260d-9058-0547-85ff-47816613c16f
This would be more Dart-style, and would allow to do some clever things that are built into language.
Now, I need to wrap this function into some Stream to get those abilities...
Not able to start foreground service from an isolate.
hello
please tell me how to set the icon for the notification ??
Flutter 1.12.13+hotfix.8
How do we run a function, particularly those of longer duration, in a foreground service just once without repeating? In native this is fairly straightforward. I am unable to implement the same here. I must be missing something but cannot find any references in the documentation.
I currently use ForegroundService in native to run a long function until completion at which point the FGS is stopped. I also use it to run a location provider, which remains active until the user has finished with the provider and service and then actively stops both.
All options I have tried are attempts to workaround the interval and failed . These include setting the interval to an arbitrarily large period say '999999' seconds and stopping at will. The problem being if the user needs to restart the service, which is of course possible and works OK, the function itself will not run again until 999999s have passed from the previous service. If I leave out the interval and stop the service, the function is called at least once more depending on the duration of the function. I can only get it to work if I set the interval slightly longer than the function run duration, thereby allowing the service to stop properly before the next function is called. In the real world the duration is not set however.
These are all workarounds to the interval requirement. There must be a simple way to just run once I have missed.
Is possible to remove or disable the notification sound just for the foreground notification? I want notifications with sound via firebase, but i every 5 seconds the app plays the notification sound from the foreground service.
Thank you in advance.
It would be great if the notification could provide us an option (in the form of a button or something similar), to kill the service when tapped. That way users don't have to open the app if they wanna stop the service, massively improving the UX of the app. If it's possible using flutte_local_notifications, then would you kindly tell me how to use that package with this package.
Hi!
I made a small application to test this plugin and noticed that this application consumes a lot of the battery. 10% in one hour. And the phone (Samsung galaxy A5 2017 with Android 8) was really warm... ...
Hot reload/restart spins forever if I ever started a service - even if I closed it afterwards
I need to close my app and install it again to make any changes
This error it shows up the first time i try to call startForegroundService, and a think this cause part of the three widgets be rebuild. For the second time, all works fine, but it seems the callback isn't getting call
The porpouse to use this plugin on my app is to check the location of the user while he/she is checking other apps, or the screen is lock.
This is what it shows on console
E/flutter (22360): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'toRawHandle' was called on null.
E/flutter (22360): Receiver: null
E/flutter (22360): Tried calling: toRawHandle()
E/flutter (22360): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter (22360): #1 ForegroundService.setServiceFunction (package:foreground_service/foreground_service.dart:144:60)
E/flutter (22360): #2 ForegroundService.startForegroundService (package:foreground_service/foreground_service.dart:121:9)
E/flutter (22360): <asynchronous suspension>
E/flutter (22360): #3 ContadorGoogleMapsRepository.setForegroundService (package:easygymclub/EleccionPopular/repository/contador_google_maps_repository.dart:126:29)
E/flutter (22360): <asynchronous suspension>
E/flutter (22360): #4 ContadorGoogleMapsRepository.startTimer (package:easygymclub/EleccionPopular/repository/contador_google_maps_repository.dart:173:7)
And this is part of the code, responsable to call foreground service
debugPrint(" ### Setting foreground service ### ");
if (await ForegroundService.foregroundServiceIsStarted())
return;
await ForegroundService.setServiceIntervalSeconds(1);
await ForegroundService.setContinueRunningAfterAppKilled(false);
await ForegroundService.notification.startEditMode();
await ForegroundService.notification.setTitle("Easy Gym Club");
await ForegroundService.notification.setText("Lets training!");
await ForegroundService.notification.finishEditMode();
await ForegroundService.startForegroundService(testFunction);
await ForegroundService.getWakeLock();
}
Function testFunction() {
debugPrint("#### The current time is: ${DateTime.now()}");
}
On performance mode works fine, but others mode, dont
It would be useful to add buttons to notification, so you can, for example, stop the service from notification.
Is this possible to implement?
For me service isn't staying in Foreground after app close.
Run: project - dont work
log error:
D/QueuedWork(28099): waited: [<1: 0, <2: 1022, <4: 0, <8: 1, <16: 0, <32: 1, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
Run: porject/android - work
IDE: Android Studio
Does anyone know what it might be?
hi , is there any way to invoke app from background when user click on the notification icon ?
I tried to install the plugin as you instructed in readme file but facing issue mentioned above.
and example is not ready to run ,main.dart is missing .cloud you please guide me how to run you example.
I added package ^2.0.0 to my pubspec.yaml and it's tripping another package (device_info).
I've edited android/gradle/wrapper from 5.6.2 to 5.6.4 but it's not fixing anything.
When I downgrade foreground_services to ^1.3.0 it compiles fine.
* Where:
Build file 'C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\device_info-0.4.2+4\android\build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'device_info'.
> Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 5.6.4. Current version is 5.6.2. If using the gradle wrapper, try editing the distributionUrl in C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\device_info-0.4.2+4\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.6.4-all.zip
Running example I get the following
e: d/.../foreground_service-master\android\src\main\kotlin\org\thebus\foreground_service\ForegroundServicePlugin.kt: (250, 69): Unresolved reference: binaryMessenger
Finished with error: Gradle task assembleDebug failed with exit code 1
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.476], locale en-AU)
• Flutter version 1.9.1+hotfix.6 at ...
• Framework revision 68587a0916 (5 months ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at ...
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: ...
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] Android Studio (version 3.5)
• Android Studio at ...
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
Like Dart Isolate natively do, I think it's very important that the foreground service has a way of communicate with the main Flutter UI. At least just a way to handle errors, results, call callbacks, etc.
For now as the service callback is run in a isolate without any ReceivePort, there are no way to do that, so this service can only do very basic or isolated tasks.
Every time running foreground function, ringing notification sound. Can I disable it?
I have following methods defined in a dart file:
void foregroundServiceFunction() {
fireNotification();
log.d("(foregroundServiceFunction) Service running");
}
Future<void> fireNotification() async {
await ForegroundService.notification.startEditMode();
await ForegroundService.notification.setTitle(NOTIICATION_SYNC);
await ForegroundService.notification
.setText("The time was: ${DateTime.now()}");
await ForegroundService.notification
.setPriority(AndroidNotificationPriority.DEFAULT);
await ForegroundService.notification.finishEditMode();
}
Following log
log.d("(foregroundServiceFunction) Service running");
was never written.
I can also see some logs
D/QueuedWork(21061): waited: [<1: 0, <2: 77103, <4: 585, <8: 108, <16: 23, <32: 5, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
being printed continuously.
Some queries
I'm trying to open the app through the foreground, but I can't access the context to call in any way, any ideas?
When using Flutter 1.5.4.hotfix2 everything is fine.
Trying to run on version 1.7.8.hotfix3 (upgrade example or in an empty project) gives the following:
D/ForegroundServicePlugin(13334): started service, making foreground
D/ForegroundServicePlugin(13334): started foreground notification, entering service loop
E/ForegroundServicePlugin(13334): unexpected error while handling intent: Methods marked with @UiThread must be executed on the main thread. Current thread: IntentService[org.thebus.ForegroundServicePlugin]
When creating a new project and performing steps 1-3, OverrideApplication.kt is located in the folder with MainActivity.kt, package default com.flutter_app. The icon near the clock appears. The terminal writes:
E/ForegroundServicePlugin(17503): Could not register plugin callback. Did you call ForegroundServicePlugin.setPluginRegistrantCallback?
D/ForegroundServicePlugin(17503): started service, making foreground
D/ForegroundServicePlugin(17503): started foreground notification, entering service loop
How to perform step 1 correctly? In the example, the tips did not find.
o want the to use this plugin to run location tracking service but the function does not run
the function code :
Future<void> foregroundServiceFunction() async {
final Location _locationService = Location();
final PermissionStatus _status = await _locationService.hasPermission();
if(_status == PermissionStatus.granted){
final LocationData location = await _locationService.getLocation();
await ForegroundService.notification
.setTitle("${DateTime.now()} | lat : ${location.latitude}");
await ForegroundService.notification
.setText("${DateTime.now()} | Long : ${location.longitude}");
}else{
await ForegroundService.notification
.setTitle("${DateTime.now()} | Permission Denied");
}
but when i test with the example function it's work fine
please need your help
hi i get this exeption when i start the service from switch button
Exception has occurred.
NoSuchMethodError (NoSuchMethodError: The method 'toRawHandle' was called on null.
Receiver: null
Tried calling: toRawHandle())
flutter 1.12.13
Hi, i have issue with Hot Reload, when i'm apply this lib and try to hot reload my project i got this error
Hot reload failed: reloadSources: (105) Isolate must be runnable
Isolate must be runnable before this request is made.
flutter doctor -v
[✓] Flutter (Channel dev, 1.21.0-1.0.pre, on Mac OS X 10.15.6 19G2021, locale en-ID)
• Flutter version 1.21.0-1.0.pre at /Users/ukietux/Library/flutter
• Framework revision f25bd9c55c (6 weeks ago), 2020-07-14 20:26:01 -0400
• Engine revision 99c2b3a245
• Dart version 2.9.0 (build 2.9.0-21.0.dev 20bf2fcf56)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/ukietux/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/ukietux/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.48.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2
I copy and paste code in the example with a fresh project just created. Once the service started it starts to print these:
D/ActivityThread(20211): SVC-Calling onStartCommand: org.thebus.foreground_service.ForegroundServicePlugin@df162cd, flags=0, startId=17995
D/ActivityThread(20211): SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@e8ad064 startId=17995 args=Intent { act=Loop cmp=com.example.background_test1/org.thebus.foreground_service.ForegroundServicePlugin }} D/ActivityThread(20211): SVC-Calling onStartCommand: org.thebus.foreground_service.ForegroundServicePlugin@df162cd, flags=0, startId=17996
D/ActivityThread(20211): SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@e8ad064 startId=17996 args=Intent { act=Loop cmp=com.example.background_test1/org.thebus.foreground_service.ForegroundServicePlugin }} D/ActivityThread(20211): SVC-Calling onStartCommand: org.thebus.foreground_service.ForegroundServicePlugin@df162cd, flags=0, startId=17997
it goes on and on each frame until I press the button to kill the service. Furthermore, it also doesn't listen to any message I send from Main-Isolate to Background-Isolate and vice versa.
Flutter 1.26.0-17.3pre
Tested on Android 6.0 Lolipop
When I added foreground_service
as a dependency, I started getting an error:
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':foreground_service' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
Would it be possible to upgrade the version of kotlin-gradle-plugin
used?
when we start FGS on some phones, such as Samsung J7, S7, and some versions of the Motorola G (n), an error is thrown that the user interface stopped and the phone FULLY crashes, just restarting the phone to be able to use.
do you know anything about it?
It will be good if the owner can add all permission and service required for foreground service.
Reproduce issue is on android 9 and 10
Hi!
It is possible to send data from the foreground service to the main app?
For example, how can i update a counter on the main UI every time the foregroundServiceFunction() is called?
Thanks!
I want an application to be running in the background to collect the location data. When the app is open , it gives a accurate result.
But , when the app is closed ,it collects location imformation at a improper interval. Some times it collects multiple records with in 10 to 20 seconds (Note : The Actual time period between collecting each record is 1 Minute).
PayLoad :
DateTime.fromMillisecondsSinceEpoch(data);
Worst Case Scenario :
When My app is running in foreground and if I open some cpu intensive app or play some games ,the system automatically closes the app.
My Android Version : Huawei Honor 9.1.0.168 (ANDRIOD PIE)
Here are some screenshots, refer the duration
![]() |
![]() |
Image 1 shows a perfect reading and Image 2 shows imperfect reading
I'm just trying out the example and this exception occured.
I'm also checking isIsolateCommunicationSetup but still it doesn't work
Hello, when I run the example in debugging the foregroundServiceFunction() function is not called, but if I stop the application and run it without debugging the code is executed.
Has anyone had this same problem?
I'm using Visual Studio Code.
In my console i receive this code:
D/ViewRootImpl@9ed879c[MainActivity]( 8786): Relayout returned: old=[0,0][1080,2280] new=[0,0][1080,2280] req=(1080,2280)0 dur=8 res=0x1 s={true 537413447680} ch=false
D/ForegroundServicePlugin( 8786): started service, making foreground
D/ForegroundServicePlugin( 8786): started foreground notification, entering service loop
D/QueuedWork( 8786): waited: [<1: 0, <2: 1020, <4: 3, <8: 1, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
I am trying to open invoke method from my MainActivity flutteractivity plugin.
Here is the glimpse of my native code :
class MainActivity : FlutterActivity() {
private val CHANNEL = "com.myapp/mymethods"
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
when (call.method) {
"myapp" -> {
val intent = Intent(this, SecondActivity::class.java)
startActivity(intent)
result.success("working")
}
}
}
}
}
Now when i try to invoke method "myapp" from dart file it throws missing plugin exception of my method. But it works when i run without isolate method
void foregroundServiceFunction() {
debugPrint("The current time iss: ${DateTime.now()}");
rint('custom calling ');
if (!ForegroundService.isIsolateCommunicationSetup) {
ForegroundService.setupIsolateCommunication((data) {
debugPrint("bg isolate received: $data");
});
}
ForegroundService.sendToPort("message from bg isolate");
static const MethodChannel channel = const MethodChannel("com.myapp/mymethods");
await channel.invokeMethod('myapp');
}
Now it gives me an error of missing plugin exception no method found myapp in com.myapp/mymethods
But when i try invokemethod from main.dart it works.
How can i invoke from foregroundServiceFunction ?
I create new clean flutter project, its work.
When install this plugin project wont work.
How to fix that?
Launching lib\main.dart on 16th in debug mode...
FAILURE: Build failed with an exception.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\Home\Desktop\flutter\asdasd\build\foreground_service\intermediates\library_manifest\debug\AndroidManifest.xml:11:9-14:121: AAPT: error: attribute android:foregroundServiceType not found.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 20s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin foreground_service...
Exited (sigterm)
FAILURE: Build failed with an exception.
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\flutter.pub-cache\hosted\pub.dartlang.org\foreground_service-2.0.1+1\android\local.properties'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: The plugin foreground_service could not be built due to the issue above.
The color of notification icon can't be changed.
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/org_thebus_foregroundserviceplugin_notificationicon" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorAccent" />
I am using this plugin for my app.If I kill the app and want to send a message to the app it says "tried to send a platform message to flutter but flutter jni was detached from native c++". I am not using FCM...
Hello,
i have followed the installation and the example.
The notification is created but it is not updated.
on the output shows:
W/lfa.demo(11343): JNI critical lock held for 46.678ms on Thread[4,tid=11455,Runnable,Thread*=0xe716b600,peer=0x13040200,"IntentService[org.thebus.ForegroundServicePlugin]"]
D/QueuedWork(11343): waited: [<1: 0, <2: 1015, <4: 8, <8: 1, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
Any idea?
Can i use the foreground service to call a geolocation service to know the position of the user? or is there a better alternative?
Thank you in advance.
I didn't found in the example project where I need to set the notification icon.
I received this error
E/ForegroundServicePlugin(15473):
could not find /res/drawable/org_thebus_foregroundserviceplugin_notificationicon; running a foreground service requires a notification, and a notification requires an icon`
And I have set the icon like that
It would be great we could use Flutter plugins (with native part) from the service.
For now, we can't even get this plugin from the service, to be able to update the notification for instance. For instance, this line return a MissingPluginException
final fgsIsRunning = await ForegroundService.foregroundServiceIsStarted();
Maybe this plugin can help :
https://pub.dev/packages/flutter_isolate
I want to track a user location continuously by combining foreground service and geolocator plugin. But It is not working. The geolocator plugin isn't running at all. please guide me what to do.
When I try to call the foreground service, the following exception is thrown:
D/ForegroundServicePlugin( 9113): started service, making foreground
D/ForegroundServicePlugin( 9113): started foreground notification, entering service loop
E/flutter ( 9113): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'toRawHandle' was called on null.
E/flutter ( 9113): Receiver: null
E/flutter ( 9113): Tried calling: toRawHandle()
E/flutter ( 9113): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 9113): #1 ForegroundService.setServiceFunction (package:foreground_service/foreground_service.dart:53:60)
E/flutter ( 9113): <asynchronous suspension>
E/flutter ( 9113): #2 ForegroundService.startForegroundService (package:foreground_service/foreground_service.dart:33:7)
E/flutter ( 9113): <asynchronous suspension>
E/flutter ( 9113): #3 ForegroundServiceProvider.initGeoLocation (package:tappers/foreground_service.dart:28:31)
E/flutter ( 9113): <asynchronous suspension>
E/flutter ( 9113): #4 _ShippingScheduleWidget.initGeoLocation (package:tappers/features/shipper/presentation/views/shipping_schedule_widget.dart:123:25)
E/flutter ( 9113): <asynchronous suspension>
E/flutter ( 9113): #5 _ShippingScheduleWidget.build (package:tappers/features/shipper/presentation/views/shipping_schedule_widget.dart:157:9)
E/flutter ( 9113): #6 StatefulElement.build (package:flutter/src/widgets/framework.dart:4047:27)
E/flutter ( 9113): #7 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3941:15)
E/flutter ( 9113): #8 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter ( 9113): #9 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2348:33)
E/flutter ( 9113): #10 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:760:20)
E/flutter ( 9113): #11 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:280:5)
E/flutter ( 9113): #12 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1033:15)
E/flutter ( 9113): #13 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:975:9)
E/flutter ( 9113): #14 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:891:5)
E/flutter ( 9113): #15 _rootRun (dart:async/zone.dart:1124:13)
E/flutter ( 9113): #16 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 9113): #17 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter ( 9113): #18 _invoke (dart:ui/hooks.dart:249:10)
E/flutter ( 9113): #19 _drawFrame (dart:ui/hooks.dart:207:3)
flutter doctor -v
[√] Flutter (Channel stable, v1.9.1+hotfix.2, on Microsoft Windows [Versionn 10.0.17763.737], locale es-419)
• Flutter version 1.9.1+hotfix.2 at C:\flutter
• Framework revision 2d2a1ffec9 (11 days ago), 2019-09-06 18:39:49 -0700
• Engine revision b863200c37
• Dart version 2.5.0
I modified ForegroundServicePlugin.kt to achieve that:
var contentText: String
get(){
return currentNotification.getExtraCompat(NotificationCompat.EXTRA_TEXT) as String? ?: ""
}
set(newText){
builder.setContentText(newText)
builder.setStyle(NotificationCompat.BigTextStyle().bigText(newText))
maybeUpdateNotification()
}
... but it probably deserves cleaner and smarter solution? But I'm no expert on notifications.
I have an issue on Android 10 that the foreground service stops bluetooth beacons from being scanned for when the phones screen is off. Would adding the below to the plugin resolve that issue?
Thanks
android:foregroundServiceType
Specify that the service is a foreground service that satisfies a particular use case. For example, a foreground service type of "location" indicates that an app is getting the device's current location, usually to continue a user-initiated action related to device location.
You can assign multiple foreground service types to a particular service.
i want to write some result with print function to test but the verbos still looping
how i can stop it
verbos example :
D/ActivityThread( 6309): SVC-Calling onStartCommand: org.thebus.foreground_service.ForegroundServicePlugin@85073f3, flags=0, startId=3046
I have an app that use this plugin, now im trying to figure it out, how to stop the service when the user kills the app by swiping it from recent apps.
Like this example:
https://stackoverflow.com/questions/19568315/how-to-handle-code-when-app-is-killed-by-swiping-in-android
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.