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.
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
use dataSync service on receiving FCM notifications #3312
use dataSync service on receiving FCM notifications #3312
Changes from 6 commits
143713b
87d515f
ab73a74
b7e5bee
f0da58b
dff11ad
4dc5324
dff2d98
b827643
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can this call be moved inside the FetchForegroundService?
Otherwise it seems we create a FetchForegroundService that does nothing except showing a notification, but then immediately start fetching messages.
If starting FetchForegroundService takes some time or somehow fails then we fetch the messages without the service actually starting and may not have network access yet.
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.
i abandoned the idea initially, as it requires an additional worker thread in
FetchForegroundService.onCreate()
- whereasFcmReceiveService.onMessageReceived()
already arrives from a worker thread. and for "just running" code, that seems fine.not having internet or being killed too soon indeed is a strong argument, so thanks for the pointer, i added a commit.
it is indeed cleaner and more logical that way - and also when it comes to other push handlers, it is good to have things more concentrated in once class