本地通知只能振动苹果手表而不发声吗?
我想在电话上安排一个本地通知。 当手机被locking,手表正在睡眠时,我想通知振动手表,但不发声。 这可能吗? 我的下面的代码运行在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];
您可以决定不设置声音名称,也不select在通知设置中使用声音。 如果还没有一个,你可以做出自己的振动行为。