-
Notifications
You must be signed in to change notification settings - Fork 35
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
Unable to pass parameters to setupBubble()
/setupNotificationBuilder()
from onStartCommand()
#28
Comments
Hi @moazelsawaf, In The reason for that is, if you pass the intent to the service multiple times throughout the service lifecycle, you must override the Therefore, in this version, EDIT: The reason is Thank you! |
Looks like a bug!. After a short investigation, I found out that it's hard to pass bubble parameters via Thank you for pointing it out 💖. |
onStartCommand()
is not called inside the class that implements FloatingBubbleService()
setupBubble()
method from onStartCommand()
Great ❤ Thank you so much @TorryDo for caring 🙏🏻❤ Waiting for the next release Insha'Allah 💪🏻❤ |
The issue is now gone in If you have any further concerns, don't hesitate to reopen the issue. Cheers 🍺🍻 |
Unfortunately, the issue still exists, 📃 Here are the logs of printing a statement in the first line of each method:
|
That's weird🤔. Did you override |
No, I am not overriding I tried now and overridden it to return 📃 Here are the new logs:
|
I'm confused now 😅. Please take a quick look at Sample (line 41 -> 60) Is your code somthing similar to this? override fun initialRoute(): Route {
return Route.Empty
}
private var size = 0
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val _size = intent?.getIntExtra("size", 0) // assume that _size = 60
size = _size ?: 0
showBubbles() // At this point, the bubble's size parameter = 60
return START_STICKY
}
... |
Hmm, sorry I was not calling 📃 Here are the new logs:
|
So you want to pass parameters to I have a plan with this stuff in the future so for now, you can do that by using the code below, which will update the notification. the val notification = // setupNotificationBuilder(channelId()) // your notification
NotificationManagerCompat.from(this).notify(notificationId(), notification) |
Do you mean I should not override |
Nope, you should override |
That is what I meant 👌🏻 It worked, but unfortunately, I have to request a new unnecessary permission from the user which is So please any other suggestion? 🙏🏻 |
Maybe I have to revamp Thank you! |
setupBubble()
method from onStartCommand()
setupBubble()
/setupNotificationBuilder()
method from onStartCommand()
setupBubble()
/setupNotificationBuilder()
method from onStartCommand()
setupBubble()
/setupNotificationBuilder()
from onStartCommand()
hi @moazelsawaf , 👋
In Android 13+, the notifications are only visible if "POST_NOTIFICATIONS" permission is granted. However, the service will still run fine without the notification. If you have any problems, don't hesitate to re-open the issue. Thank you! |
Thanks for your concerns ❤ Should I handle the notification my self or it is already handled inside the library? |
If you want the notification visible, first add "POST_NOTIFICATIONS" to your manifest file. Then ask for the permission. If you don't want to ask for the permission, the service will still run fine. 🍀 Feel free to ask if you have any further concerns. |
Thank you so much ❤ Now everything is clear, I will add the permission request for Android 13, but I wanted to ask a question, in the old logic in the earlier versions, would it be also a must to request the |
No, it's not required. You can find more info here: Android Service. |
Thank you so much for the clarification 🙏🏻❤️ |
Hello Dear,
I was using version
0.5.0
and everything was working fine, but I wanted to upgrade to the latest version (v0.5.1
) to have the new updates, unfortunlly, my class which implements theFloatingBubbleService()
has an override foronStartCommand()
method, once I upgraded the dependency, this overridden method stopped working, it is not called at all.NOTE: I have made sure that I am registering the service in the
<application>
tag in theManifest
file and starting the service with an intent.Also I would like to mention that I am using this method to initialize a
lateinit
variable that holds a value passed from the intent that starts the service to be used insidesetupBubble()
method, so if you have a better way to do that please suggest.I would be glad if you could help me with this issue 🙏🏻
Thanks in Advance 🙏🏻❤
The text was updated successfully, but these errors were encountered: