-
Notifications
You must be signed in to change notification settings - Fork 67
DROID-3636 Notifications | Firebase device token #2406
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
DROID-3636 Notifications | Firebase device token #2406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates Firebase Messaging for device token retrieval by replacing the legacy SharedPreferences-based implementation. Key changes include:
- Replacing local token storage with Firebase token retrieval in DeviceTokenStoringServiceImpl.
- Adding Firebase messaging dependencies in build.gradle.
- Removing SharedPreferences injection from the DI module.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
device/src/main/java/com/anytypeio/anytype/device/DeviceTokenStoringServiceImpl.kt | Refactored token storage to use FirebaseMessaging and removed SharedPreferences usage. |
device/build.gradle | Added Firebase BOM and Firebase Messaging dependency. |
app/src/main/java/com/anytypeio/anytype/di/main/SubscriptionsModule.kt | Removed SharedPreferences injection in favor of the new Firebase-based approach. |
device/src/main/java/com/anytypeio/anytype/device/DeviceTokenStoringServiceImpl.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the device token handling to use Firebase Messaging for retrieving the device token, eliminating the dependency on SharedPreferences in favor of real‐time token fetching. Key changes include:
- Removal of SharedPreferences injection and usage in DeviceTokenStoringServiceImpl.
- Integration of FirebaseMessaging token retrieval with corresponding success and failure handling.
- Updates to build.gradle and dependency injection to support Firebase Messaging.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
device/src/main/java/com/anytypeio/anytype/device/DeviceTokenStoringServiceImpl.kt | Replaces SharedPreferences token handling with FirebaseMessaging token fetch and updates token accordingly. |
device/build.gradle | Adds Firebase BOM and Firebase Messaging dependency. |
app/src/main/java/com/anytypeio/anytype/di/main/SubscriptionsModule.kt | Removes injection of SharedPreferences in favor of the updated token storing service. |
Comments suppressed due to low confidence (1)
device/src/main/java/com/anytypeio/anytype/device/DeviceTokenStoringServiceImpl.kt:39
- [nitpick] Consider renaming 'proceedWithUpdatingToken' to something like 'updateDeviceToken' to more clearly reflect its purpose.
private fun proceedWithUpdatingToken(token: String?) {
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?