Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WatchKit Notification Sash Color

Tags:

ios

watchkit

I've set my notification sash color in storyboard and it works fine in the simulator, but it shows up as 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 to show the color properly? enter image description here

like image 732
n6xej Avatar asked May 20 '15 00:05

n6xej


1 Answers

The sash color is set for the WKNotificationCategory in the storyboard, which has a name. (In your screenshot "myCategory"). Then, for the correct sash color to appear on the real device, the push notification needs to have the matching category name when you send it.

UILocalNotification *notification = [[UILocalNotification alloc] init];
if (notification) {
    notification.alertBody = @"Hello";
    notification.category = @"myCategory";
    [[UIApplication sharedApplication] scheduleLocalNotification:notification];
}
like image 190
Mr. Zystem Avatar answered Oct 03 '22 09:10

Mr. Zystem