Giter Club home page Giter Club logo

foreground_service's People

Contributors

michael-cheung-thebus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

foreground_service's Issues

Migrate to Flutter 1.12

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?

Run Function just Once option

Hi @michael-cheung-thebus

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.

Notification Sound

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.

battery drainage

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... ...

Exception: NoSuchMethodError: The method 'toRawHandle' was called on null.

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

Add buttons to notification

It would be useful to add buttons to notification, so you can, for example, stop the service from notification.

Is this possible to implement?

When you run the flutter project it doesn't work.

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?

Gradle version?

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 results in ForegroundServicePlugin.kt: (250, 69): Unresolved reference: binaryMessenger

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)

[Feature Request] 2 Ways communication

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.

print() or log is not called.

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.

  1. Why logs were never printed? Is the service not running? When I call kill the app, my console disconnects so I couldn't monitor if the logs are being printed in background.
  2. On first launch I can see the notification I set before calling startForegroundService(), but after the schedule time notification doesn't change. If I kill the app and start again, notification set in the method is displayed. Why this behaviour?
  3. What are these extra logs that are being printed?

Some queries

  1. In function fireNotification(), Is it necessary to start edit mode before making change to notification being displayed?
  2. Is it possible to pass event to UI on tap of notification being displayed? How to configure onTap for the notification?
  3. The notification currently configured is inbuilt to foreground_service and I couldn't find any method in ForegroundService.notification class to configure custom notification or media notification with foreground_service. Is it possible?

The example does not work in Flutter 1.7.8.hotfix3

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]

Could not register plugin callback

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.

my function don't executed

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

i get exception when start service from switch button

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

Issue with Hot Reload

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

Logging weird error continuously once the service started and Isolate can't hear message

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

Kotlin Gradle plugin version error

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?

IU interface is broken

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?

Location Service, Timing Issue and Service Stops

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 :

  1. getting Device Current location for every one second
  2. It Reading/Writing single record in two SQFLITE database
  3. Time computation from 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

Do not run the service when debugging

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]

Unable to invoke method of MainActivity FlutterActivity plugin

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 ?

Dont work

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.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

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.

  • What went wrong:
    Could not determine the dependencies of task ':compileReleaseAidl'.

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.

[URGENT] can't change the color of notification icon

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" />

Flutter JNI detached

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...

Not updating notification

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.

Notification icon

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

Screenshot from 2020-04-09 11-23-33

[Feature Request] Use plugin from service

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

Unhandled Exception: NoSuchMethodError: The method 'toRawHandle' was called on null.

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

Feature request: Support Multiline text in notifications

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.

Add location to the foreground service

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.

how i can stop vepos

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.