-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add support for mark-read-generic
and mark-read-messages
#4443
Open
haileyok
wants to merge
36
commits into
main
Choose a base branch
from
hailey/decrement-badge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Your Render PR Server URL is https://social-app-pr-4443.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cpig7dug1b2c73cbo830. |
The Pull Request introduced fingerprint changes against the base commit: Fingerprint diff[{"type":"dir","filePath":"modules/expo-background-notification-handler/android","reasons":["expoAutolinkingAndroid"],"hash":"64c51c85980a54b168c887d76bcf94fbd1fa1ace"},{"type":"dir","filePath":"modules/expo-background-notification-handler/ios","reasons":["expoAutolinkingIos"],"hash":"0d41246ffadb0207381c45ada5b3b32d31f236ac"}] Generated by PR labeler 🤖 |
|
update kotlin stub update js types update the correct badge count clamp single decrements too clamp decrement future proof with `decrementBy` add support for `mark-read-generic` and `mark-read-messages` do nothing when receiving `mark-read-*` is received simplify swift update android with new types add types to `NotificationReason` add logic for decrementing the badge add decrement mutation
haileyok
force-pushed
the
hailey/decrement-badge
branch
from
June 10, 2024 15:33
26c9e1c
to
7dad1c2
Compare
haileyok
force-pushed
the
hailey/shared-preferences
branch
from
June 26, 2024 18:05
1a8a154
to
37ff335
Compare
haileyok
force-pushed
the
hailey/shared-preferences
branch
from
June 26, 2024 18:53
ac0ba3a
to
6823d10
Compare
haileyok
force-pushed
the
hailey/shared-preferences
branch
3 times, most recently
from
July 2, 2024 01:08
fad6f51
to
6f96bb7
Compare
haileyok
force-pushed
the
hailey/shared-preferences
branch
from
July 2, 2024 01:11
6f96bb7
to
ffe15a9
Compare
This should be ready for testing now as soon as we deploy the courier and appview changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
We've added support for badge incrementing through #4005 and #4233. However, as of right now the only way to "decrement" the badge is to open the app and opening your notifications tab. Instead, we want the badge to decrement in every possible case:
How
Right now, we use
updateSeen
to mark notifications having been "read". This works alright, but it doesn't give us any solid info or granularity. Nonetheless, for now we can just know that our "generic" notification badge count is going to drop to zero any timeupdateSeen
is called.In the case of messages, we again do not have a good way to "mark all as read". So, we will currently rely on just decrementing the messages badge count by one whenever we receive a
mark-read-messages
.In both of these cases though, we should anticipate being able to provide a "count" of messages to decrement by. Therefore, in both cases I've added the ability to pass along a
decrementBy
field in the notification, which will tell the client to decrement the badge by that number of notifications. the current implementation makes this a little bit sketchy - sometimes we don't actually receive push notifications, I'm not sure why and that needs to get investigated - so this is solely a "looking forward" bit of logic rather than something we're going to do right now.Test Plan
We'll first need to deploy the backend changes (bluesky-social/atproto#2567), at which point we'll start receiving
mark-read-generic
reason notifications. The good news is that we can test this at any time, since we do not need to supply atitle
orbody
field for the notification, and as such iOS will not display it to the user anyway - even without the NSE "intercepting" the notification.mark-read-generic
notification onupdateSeen
atproto#2567Testing that notifications with empty
title
andbody
do not show up on iOSScreen.Recording.2024-06-08.at.6.21.02.PM.mov