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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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];
}