【发布时间】:2016-04-24 03:45:58
【问题描述】:
我想在手机上安排本地通知。当手机锁定并且手表处于睡眠状态时,我希望通知振动手表但不播放声音。这可能吗?我下面的代码在 iphone 上运行以安排通知,但不知道如何在手表上播放时抑制声音。
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.fireDate = [[NSDate date] dateByAddingTimeInterval:60];
notification.alertTitle = [NSString stringWithFormat:@"Hi # %d", i];
notification.alertBody = @"Hello!";
notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
【问题讨论】:
标签: ios notifications watchkit