From alertLocalizationKey - Apple Developer Documentation:
Set this property’s value to have the system display a localized string when it receives the corresponding push notification. The system uses the key to find the matching string in your app’s Localizable.string file. If you specify a value for this property, CloudKit ignores the alertBody property’s value.
Say one of my CKRecord
’s field is documentType
, whose contents are enums like TEXT_FILE
, IMAGE_FILE
.
In my Localizable.strings
there are rows like "TEXT_FILE": "Plain Text";``"IMAGE_FILE": "图片";
.
So CloudKit stores my app’s localization key rather than the content.
If I set alertLocalizationKey
to %1$@
and alertLocalizationArgs
to ["documentType"]
, I got notifications like TEXT_FILE
or IMAGE_FILE
which are definitely not what I want.
How can I localized notifications in such case? I don’t want to store localizations in CKRecord.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…