My application supports 4 languages & push notifications. When I send push notification to APNS , I am sending loc_key
& loc-args
. Now I need to send localized strings in loc-args
array so that I can translate those on iOS app side when app receives the push notification.
But when I send localized strings in loc-args
, instead of showing translated string in notification center , it just showed localized key as it is.
My string file contains below 2 messages:
"WINNER_ALERT"= "Congratulations! %@ won the match & became %@ player";
"ROLE_PROFESSIONAL_LOCALIZED_KEY" = "professional"
Server sends below payload
{
aps = {
alert = {
"loc-args" = (
"John",
"ROLE_PROFESSIONAL_LOCALIZED_KEY"
);
"loc-key" = "WINNER_ALERT";
};
badge = 1;
sound = default;
};
}
When I send above payload then in iOS Notification Center , message look like
Congratulations! John won the match & became ROLE_PROFESSIONAL_LOCALIZED_KEY player
instead of
Congratulations! JOHN won the match & became professional player
Can anyone tell me whether it is possible to send localized strings in loc-args
? If yes, what's wrong in my payload ?
Thanks in advance