When sending a push notification through GCM (switching to FCM soon) to an Android device, how can I localize numbers that appear in the message title/body based on the language of the phone?
Example Message:
John Doe 137
If the device language is set to Arabic the numbers should localize
Localized Message
John Doe ١٣٧
Since I don't know the users device language when sending the notification, how can I localize the number when the message is received? The onMessageReceived callback does not execute unless the application is running in the foreground, so I can not perform a string replacement on the numbers there.
For context Below is an example of the gcmNotification JSON I'm sending to GCM from my services which is taking advantage of some of the other localization params the payload allows you to use.
"gcmNotification": {
"title_loc_key": "some_title_key",
"title_loc_args": "[\"john\", \"Doe\", 137]",
"icon": "TheIcon",
"body_loc_key": "some_key",
"sound": "somesound",
"color": "Blue",
"collapse_key": "somekey",
}