Skip to content
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

refactor push notification registration and fix re-registration issue #1501 #1506

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

bryanmontz
Copy link
Contributor

Issues covered

#1501

Description

Addresses an issue where push notifications are not re-registered for after the initial registration in a session when the user signs out and then into another account.

I ended up doing a refactor of how this is done to make the registration more isolated, encapsulated, and maintainable.

How to test

  1. Sign in to an account.
  2. Go to the Notifications tab and allow notifications.
  3. Force-quit the app.
  4. Relaunch the app.
  5. Sign out.
  6. Sign in to a different account.

Prior to the changes in this PR, you will not receive push notifications associated with the newly signed-in account. After the changes, you will.

Screenshots/Video

Before:
You can see in the video below that when you launch the app signed in to an account, then sign out, then sign in to a different account, the user/device is not re-registered for push notifications.

before.mp4

After:
In the after video below, you can see that the user is registered for notifications on launch, then when the user signs out and then into another account, the new account is registered for push notifications.

after.mp4

Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this looks much better, and it works!

Nos/Service/PushNotificationRegistrar.swift Outdated Show resolved Hide resolved
Nos/Service/PushNotificationRegistrar.swift Show resolved Hide resolved
Copy link
Contributor

@joshuatbrown joshuatbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks for catching and fixing this!

# Conflicts:
#	CHANGELOG.md
#	Nos.xcodeproj/project.pbxproj
@bryanmontz bryanmontz added this pull request to the merge queue Sep 18, 2024
Merged via the queue into main with commit 48cd898 Sep 18, 2024
4 checks passed
@bryanmontz bryanmontz deleted the bdm/1501 branch September 18, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants