WatchKit notification color

I set the color of the notifications in the storyboard, and it works fine in the simulator, but it looks gray on my watch. Does anyone know if this is a known issue, or do you need to do something at runtime on a real device in order to correctly display the color? enter image description here

+6
source share
1 answer

The spread color is set for the WKNotificationCategory category in the storyboard that has a name. (In your screenshot is "myCategory"). Then, in order for the correct color of the belt to be displayed on the real device, the notification of pressing should have the name of the corresponding category when sending it.

UILocalNotification *notification = [[UILocalNotification alloc] init]; if (notification) { notification.alertBody = @"Hello"; notification.category = @"myCategory"; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; } 
+2
source

Source: https://habr.com/ru/post/987536/


All Articles