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

More FCM infra: wire up token registration, analytics, toasts, primer… #226

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

prashanDYDX
Copy link
Contributor

… dialog.

i haven't had a chance to test this end to end yet.

private val sharedPreferencesStore: SharedPreferencesStore,
) : PushPermissionRequester {

var requestPermissionLauncher: ActivityResultLauncher<String>? = null
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

@prashanDYDX prashanDYDX Sep 19, 2024

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.

Copy link
Contributor Author

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

@prashanDYDX prashanDYDX merged commit 50aceb7 into develop Sep 19, 2024
5 checks passed
@prashanDYDX prashanDYDX deleted the prashan/push-work branch September 19, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants