-
Notifications
You must be signed in to change notification settings - Fork 2
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
More FCM infra: wire up token registration, analytics, toasts, primer… #226
Conversation
...tegration/fcm/src/main/java/exchange/dydx/trading/integration/fcm/PushPermissionRequester.kt
Outdated
Show resolved
Hide resolved
private val sharedPreferencesStore: SharedPreferencesStore, | ||
) : PushPermissionRequester { | ||
|
||
var requestPermissionLauncher: ActivityResultLauncher<String>? = null |
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.
Where does this get initialized?
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.
in the set()
for activity
- this API is really awkward and requires an Activity
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.
happy to huddle on this to explain what's going on here.
basically you can't get an Activity
injected via Hilt into a ViewModel, because of the component structure: https://dagger.dev/hilt/components.html
so we need to pass TradingActivity in onCreate/onDestroy to the PushPermissionRequester. when activity
changes, we need to update requestPermissionLauncher
.
this should almost never happen since we're an single-activity app, but handling it just in case.
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.
oh oops yeah i forgot to assign this in the setter
… dialog.
i haven't had a chance to test this end to end yet.