Closed jaypokar closed 1 month ago
hello, @jaypokar
try this
The service name (android:name) should be as below.
<!-- Warning: Do not change service name. -->
<service
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="dataSync|remoteMessaging"
android:exported="false" />
goto android/app/proguard-rules.pro
-> add -keep class com.pravera.flutter_foreground_task
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
-keep class com.pravera.flutter_foreground_task.* { ; }
I am not using the service at all, not even starting the service from this. I am using this only to check that my app is in foreground or to launch the app when it's in background that's it.
@jaypokar
I think this plugin does not suit your purpose.
You will need to add the service tag in manifest for this plugin to work properly.
actually I have updated this to latest version but it was working well before in flutter_foreground_task: ^6.5.0, which I have been using.
@jaypokar
you're right. In the new version, i check whether to restart the service by looking at the status of the service tag.
An exception occurs if the component name cannot be found here.
However, the lower the possibility of exceptions occurring, the better, so this part will be handled as an exception in the next version.
You can fork this project and use it until a new version is published.
db2abe4a569b818978fabcfb25902101d0053050
@jaypokar
Version 8.10.4 has been published.
Please check and let me know if there are any problems.
Fatal Exception: java.lang.RuntimeException Unable to start receiver com.pravera.flutter_foreground_task.service.RebootReceiver: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{partner.dropon.delivery/com.pravera.flutter_foreground_task.service.a}