Notification's alertBody not localized when using UserNotifications FW on iOS and UILocalNotification on watchOS

Originator:markus.michel
Number:rdar://30734187 Date Originated:2017-02-27
Status:Open Resolved:
Product:iOS + SDK Product Version:
Classification:UI Reproducible:Always
 
Summary:
The new UserNotification framework provides a nice way to send localized notifications. The NSString category localizedUserNotificationStringForKey:arguments: can be used to set a translation key and arguments for the alert body of a notification.

The problem:
If a watch app uses the UILocalNotification API under watchOS 2.x or 3.x, this auto-magic translation does not work for dynamic notifications.

I would expect the information provided by the system in UILocalNotification.alertBody is the translated, human readable string. Instead, the localizable key provided to UNNotificationContext by sender is used.

Compare:
When the watch shows the static notification, everything is translated correctly.

See sample application with iOS app (deployment target 10.x) and watchOS App (deployment target 2.x) demonstrating the issue. (https://github.com/DEAD10CC/radars/tree/master/watchOS2-alertBody-not-localized)

Steps to Reproduce:
- Install sample app on iOS 10.x device
- Install sample app on watchOS 2.x or 3.x device
- Start iOS app
- Start watch app at least once to enable dynamic notification handling (correct, huh? if so, please add this somewhere in your docs)
- Press "send notification in 4sec" button.
- Press on/off button on iPhone
- wait for notification to appear on watch

Expected Results:
- Notification UI should show text in red "Is localized".

(An additional orange text "dynamic long look" indicates that you see the dynamic UI)

Actual Results:
- Notification UI shows text in red "should_be_localized".

(An additional orange text "dynamic long look" indicates that you see the dynamic UI)

Version:
iOS 10.x, watchOS 2.x, watchOS 3.x

Notes:


Configuration:
iPhone and Apple watch

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!