Rexios80 / wear_ongoing_activity

Create and maintain ongoing activity notifications on Wear OS
https://pub.dev/packages/wear_ongoing_activity
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Not working anymore #4

Closed almararn closed 3 weeks ago

almararn commented 3 weeks ago

This package stops working when you choose targetSdk=34 which is now the minimum in playstore.

E/MethodChannel#wear_ongoing_activity( 7281): Failed to handle method call E/MethodChannel#wear_ongoing_activity( 7281): android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{111e01a 7281:com.example.wear_ongoing/u0a116} targetSDK=34

Also in the current Version of Flutter (3.24.2) this line in AndroidManifest.xml: android:foregroundServiceType="health|remoteMessaging|..." - causes error, and wont work unless deleting the three dots along with the separator at the end.

There is no documentation about the "workout" file that needs to be in folder "drawable": category: NotificationCategory.workout, // This must be a file in "android/app/src/main/res/drawable" What file must be there? There is not a file like that in the example project on GitHub.

Hope you consider updating your package and documentation, as it seems to be the only one available to add the "ongoing activity" to a flutter wear os app, that is now a requirement for play store.

Rexios80 commented 3 weeks ago

This package stops working when you choose targetSdk=34 which is now the minimum in playstore.

I upgraded the example app to SDK 34 and there were a few minor issues, but they were not issues in the plugin. I fixed the example app issues and it works fine. I also updated the README to reflect these changes.

android.app.MissingForegroundServiceTypeException: Starting FGS without a type

Do you not have android:foregroundServiceType in your manifest? Or did you pass an empty set into foregroundServiceTypes?

Also in the current Version of Flutter (3.24.2) this line in AndroidManifest.xml: android:foregroundServiceType="health|remoteMessaging|..." - causes error, and wont work unless deleting the three dots along with the separator at the end.

Well yeah... it's a placeholder because those types are app-specific. You should not be recklessly copying sample code.

There is no documentation about the "workout" file that needs to be in folder "drawable": category: NotificationCategory.workout, // This must be a file in "android/app/src/main/res/drawable" What file must be there? There is not a file like that in the example project on GitHub.

That comment isn't even on that line... It's talking about the ic_launcher file specified below which is in the example project at example/android/app/src/main/res/drawable/ic_launcher.png

almararn commented 2 weeks ago

Thanks for a quick and thorough response. I've tested it and it's working perfectly. So I will add it to my project.

I probably didn't have android:foregroundServiceType in the manifest in the example I posted here above, because the placeholder confused me, and I was trying to find a way to build the project. But it all makes sense now.