Google Maps Notifications #1827
Labels
No labels
device mi band 7
activity post processing
activity/health
Android 12
Android 13
android integrations
architecture
Bangle.js
bug
changes requested
charts
deprecation notice
details not provided
developer documentation
device amazfit band 5
device amazfit bip
device amazfit cor
device Casio
device fossil
device garmin
device gtr 2e
device gts 2 mini
device h30
device hplus
device huami
device Huawei
device liveview
device mi band
device mi band 2
device mi band 3
device mi band 4
device mi band 5
device mi band 6
device no.1 f1
device pace
device pebble
device pebble 2
device pinetime infinitime
device request
device sony
device support
device watch 9
device xiaomi
discussion
documentation
duplicate
enhancement
feature request
Gadgetbridge
good first issue
help wanted
i am developing my own app can you help
icebox
intent api
internationalisation
invalid
needs work
network companion app
new device
no feedback
not a bug
notifications
one of the 1000 issues about disconnection
pairing/connecting
potentially fixed / confirm and close
question
research
security
seems abandoned
Solved, waiting for F-Droid release
suggest to close
task
user interface / UX
wear os
weather
wontfix
Zepp OS
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Freeyourgadget/Gadgetbridge#1827
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before reporting a bug, please confirm the following:
I got Gadgetbridge from:
If you got it from Google Play, please note that version is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.
Your issue is:
I'd like to be able to get Google Maps notifications forwarded to my watch (in the notifications display they have helpful info like the distance to the next turning). It seems like Gadgetbridge is picking them up and deciding they are not important enough to show because the 'local only' flag is set (in NotificationListener.shouldIgnoreNotification).
I included a log, but the relevant part seems to be:
If I tick the checkbox in the 'Blacklist' menu I get a log message saying it was Blacklisted, so Gadgetbridge is definitely finding it. Would it be possible to add another checkbox in 'Blacklist' or elsewhere that said 'allow local only'? I see there are already hard-coded exceptions for Wechat/outlook/skype
Your wearable device is:
Bangle.js
Your android version is:
9
Your Gadgetbridge version is:
Git master as of today
New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.
@gfwilliams
Not, currently this is hardcoded, if google maps notification make sense the way they are, then we could also whitelist them.
Can you test that?
I do not have the google apps on my android devices.
Just tried it (I have to ignore 'ongoing notifications' too as it seems otherwise I don't get anything at all), and I get:
So I think it could be useful. The gotcha is that it seems the notification is posted every second, and despite being identical in ID and text the notifications are passed right through.
I'm not sure how other devices work, but do you think things would break if I kept track of the last few notifications (by ID) and only passed new ones through if the content changed?
@gfwilliams
We ignored ongoing notification because
The idea of only sending them when they change sounds reasonable for Maps, you can send a PR for that if you want, but I would not unlock that feature for ALL apps (beacuse of the progress bars). I an also imagine that it happens with maps when route calculates and there is a progress bar, so please check that also ;)
Thanks - I'll have to do some tests. It's not like you want a new notification whenever you move 1m nearer your destination!
Is there anything in place to handle notification updates? Obviously there's the ID that wouldn't change, but the assumption is that
onNotification
is always called with a new ID?Going forward, would you be ok with me adding a
onChangedNotification
with an empty default implementation and then adding that to Bangle.js?Some devices crash even when notifications are updated that fast, not to mention the battery impact.
That sounds as if you plan to handle those notifications differently (do you plan any navigation app on the bangle.js itself?)
If so it might be better to do something like "onNavigationInfo" or whatever so that device implentations could also do something special or just turn that into a standard notification if they must.
The above proposal would imply dissecting the notification further (with eta etc) and I am not sure how feasable that is, assuming translations and differen versions.
Probaby for bigger changes we should use a branch, for something quick and dirty just do it in the notification receiver with some tweak for google maps, without changing the interfaces...
Ok, thanks! Yeah, the issue with onNavigationInfo would be getting all the data. I imagine I'd have to hook onto something maps-specific which is a bigger undertaking than I had hoped for. Trying to pull it out of the Notification text using what'd basically be a regex sounds like something that'd break very easily.
The idea of a
onChangedNotification
would be to open up these kinds of events (there must be other apps too) to app developers on Bangle.js - but yes, that's probably a step too far at the moment.I'm actually finding that right now I'm getting a bit swamped with work, so I'm afraid I'm not going to have a chance to look into this for a few weeks at least. Feel free to close this if that's an issue, and I can reopen it when I have a fix?
Could it be the reason why I'm not getting notifications from IFTTT on my Mi Band 4?
Seems like yes :)
https://developer.android.com/reference/android/app/Notification.html#FLAG_LOCAL_ONLY
FLAG_LOCAL_ONLY
flags field that should be set if this notification is relevant to the current device only and it is not recommended that it bridge to other devices.
So the app is telling us that we should not forward the notification. This can be overwritten by Gb: #1109
Which is also showing you @m-p-3 what you need to provide (app package name), if it should be changed :)
I feel like having another option in the 'Notification Blacklist' menu would be great here.
So, I finally got my act together and gave it a stab:
1869b5686c
Seems to work great - you go to 'Notification blacklist', your app, preferences (right) then click on 'Show local notifications' and save, then they'll show up.
Could someone have a look over this? It's the first time I've done UI or database stuff in Gadgetbridge so I'm not entirely sure if it's done correctly.
Closing this now - last time I tried this the notification hash kept changing so new notifications kept being added