1

I send localized push notification from API.

{
"id": "234",
"url": "https://...",
    "aps": {
        "alert": {
            "loc-key": "pushNotificationVoteKey",
            "loc-args": ["Jack", "5"]
        }
    }
}

And app receives push with title "Jack has got 5 points", but when Jack will get 1 point push notification will be the same "*Jack has got 1 points" except of "Jack has got 1 point"

Any chances pluralize background push notifications with .stringdict or any other ways to do it on mobile side?

Atlantis
  • 725
  • 7
  • 26
  • 1
    Please share your code where you parse the push – koen Oct 08 '19 at 14:55
  • 1
    @Koen There should be any code for background push notifications? – Atlantis Oct 08 '19 at 14:56
  • [Similar question here](https://forums.developer.apple.com/thread/101992) shows that you can localise it with `.stringdict` but only for local notifications. – user28434'mstep Oct 08 '19 at 15:01
  • 1
    @Atlantis: Somehow that input must be parsed from `["Jack", "5"]` to `Jack has got 5 points`. – koen Oct 08 '19 at 15:09
  • @Koen, just google `loc-key` and `loc-args` and what iOS does with them when it receives push notification. – user28434'mstep Oct 08 '19 at 15:12
  • 1
    @Koen I haven’t code for that. iOS search values by key in ‘’’Localizable.strings’’’ by itself and I just pass key and params into push – Atlantis Oct 08 '19 at 15:14
  • This page talks about plural rules for Stringsdict File Format: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/StringsdictFileFormat/StringsdictFileFormat.html – koen Oct 08 '19 at 17:47
  • Or here: https://medium.com/@vitaliikuznetsov/plurals-localization-using-stringsdict-in-ios-a910aab8c28c – koen Oct 08 '19 at 17:48
  • @Koen, those for formats in the string **in the app itself**. Question is about localisable strings in the **push notifications**, and why it doesn't use `.stringdict`. That completely different domain. Tangent, but different. – user28434'mstep Oct 09 '19 at 09:02

0 Answers0