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

Add support for Android push notification localization in foreground notifications #772

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

fordkilleen
Copy link

@fordkilleen fordkilleen commented Oct 17, 2022

PR Type

What kind of change does this PR introduce?

  • Feature

New features/enhancements:

  • Exhaustive testing has been carried out for the new functionality
  • Regression testing has been carried out to ensure no existing functionality is adversely affected
  • Documentation has been added / updated
  • The example project has been update to validate/demonstrate the new functionality.

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 and title 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?

  • No

Links

Android Notification object documentation
Cloud Messages with localization example

@dpa99c dpa99c changed the base branch from master to dev November 23, 2022 13:47
@dpa99c dpa99c merged commit 4061262 into dpa99c:dev Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants