-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
Separate notification displaying from the service lifecycle #847
Comments
Let's break down what use cases might exist, that might help to come up with what and how we should change
Now let's take a look of what set of properties in
notificationCreated=null|false -> true, processingState=idle
notificationCreated=any value (no-op), processingState=idle -> not idle
notificationCreated=true, processingState=not idle -> idle
notificationCreated=null|false, processingState=not idle -> idle notificationCreated=true -> false, processingState=idle What the new parameter should doThe notification is by default bound to
Fixing edge cases and separating responsibilities of
|
What do you mean by "fake" notification? Just copying my comment from #849 :
|
By that I mean the notification created/updated when state is
I think you didn't understand. This new |
I didn't mean to imply that it was the same thing, in fact mine is quite a different approach but it seemed you wanted the discussion of my approach over here as well so that we can consider the different approaches together. |
Ok I see. It seems to me that with your approach 2. a. and 3 could not be accomplished, could they? |
With 2a, I think I could support that via |
How do you distinguish between 1a and 3? In both cases you have
I mean, you could, but wouldn't |
Well I don't want to just map states to states. I would rather map state transitions. So inside the Android
I'm not necessarily against making |
I see it now. I don't like the fact that there's a moment where notification is shown but cannot be updated, i.e. when Also, I don't like the name of |
That's a fair point. Inside the Java code, the condition could be something like I'm also in favour of renaming |
I forgot to mention that what I said above should not just consider |
Another thing is to remove this notification you need to set |
Simple solution to that: notification is cancelled as soon as |
At this point both of our approaches seem to be pretty similar, SGTM then. |
One thing I just want to be careful of with this change is that I don't cause a regression of #462 which I think is when I first introduced the Java |
Just thinking on this more, are you able to share the actual use case where you want to show the notification before entering foreground? I want to ensure that whatever solution is adopted that the most common scenario has very little friction, and that would be to start showing the notification when entering foreground. Then a secondary consideration is how to ensure that other use cases can also be supported, even if they might have more friction than the common scenario. I understand well the common scenario of most media apps which is that the notification only appears after the first time you actually start playing. Of course I can imagine other apps with special requirements, but I'm just curious to know what they are before making an API decision. |
Maybe there is also a way to combine both approaches where by default the plugin tries to implement best practices for a media app by showing the notification on |
To be honest the intention behind this proposal was to make the lifecycle more clear. Adding new functionality, that is creating a notification beforehand the service, is a needed step to adopt the proposed model. However, I don't have an actual use case to share with you, unfortunately. So it's a tradeoff between clarity (as it seems to me) of new parameter and a functionality that no one will probably ever use, but we can't know for sure. Supporting it however, is not a big hassle, so I would choose clarity. That said, I don't mind if you want to keep the current model. |
Is your feature request related to a problem? Please describe.
Currently notification can be created if
playing == true
andprocessingState == idle
.But also currently the service will be stopped if
playing == true
andprocessingState == idle
, removing the notification as well.This makes it inconsistent and therefore hard to understand from the point of the user of this API, especially, because it's not documented.
Describe the solution you'd like
What we actually would like is to let
processingState
to manage the lifecycle of the service andplaying
and other parameters to update the look of the notification, because notification can exist without the service running, then also update the documentation accrodingly (#655)Describe alternatives you've considered
No
Additional context
Extracted from discussion in #834
The text was updated successfully, but these errors were encountered: