Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What if app bundle does not contain a key for the "loc-key" received in push notification?

According to apple documentation, notification payload can carry "loc-key" key which identifies localization string key in app bundle. What will happen if there will be no such key in app's bundle (for instance, when there were updates on the server and new notification types were added)?

like image 763
peetonn Avatar asked Apr 17 '13 09:04

peetonn


2 Answers

You will most likely get the default behaviour of NSBundle's localizedStringForKey:value:table: method which is to return the key when the value can not be found.

like image 171
Mike Weller Avatar answered Oct 13 '22 11:10

Mike Weller


You can send your message template in loc-key: "%1$@ won the game" with "John" in loc-args will become "John won the game", though you app doesn't have "%1$@ won the game" in Localizable.strings.

like image 32
user3447843 Avatar answered Oct 13 '22 10:10

user3447843