Add support for Android push notification localization in foreground notifications #772
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.
PR Type
What kind of change does this PR introduce?
New features/enhancements:
What is the purpose of this PR?
The purpose of this PR is to address #771 and add support for localization inside of the foreground push notifications.
Mainly, all this PR does is introduce support for the below keys and allows the sender of the notification to have foreground notifications with localized content, which prior to this PR was not supported. Previously the foreground notification would not display at all because the
body
andtitle
were null when sending down only localized content.Missing keys from the foreground notification check which are being added and supported:
title_loc_key
title_loc_args
body_loc_key
body_loc_args
This does not affect existing behavior as it only attempts to set the title and body if the localization key exists. Otherwise it behaves the same as it would have without the added support.
I have run testing in my current solution to check this works as intended with and without the localization in the remote message. Everything looks good. It is a pretty minimal change but very useful. Apologies for not trying this against the example application yet I've just not had the time.
Obviously if there are any concerns or issues with this PR let me know! Thanks for the great work with this codebase so far!
Does this PR introduce a breaking change?
Links
Android Notification object documentation
Cloud Messages with localization example