【发布时间】:2017-05-24 06:00:34
【问题描述】:
在我的 iPhone 应用程序上,我创建了 UILocalNotification。我想知道如何在 Apple Watch 上同步 UILocalNotification。这意味着当通知出现在 iPhone 上时,让通知出现在 Watch 上。
这是我的 UILocalNotification(此通知出现在 91 秒内,我想出现在手机和手表中):
UILocalNotification *verif_exterieur_notification = [[UILocalNotification alloc]init];
verif_exterieur_notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:91];
verif_exterieur_notification.alertTitle = @"Vérifications extérieures:";
verif_exterieur_notification.alertBody = @"Assurez vous d'avoir bien vérifié(e) l'éxterieur de votre avion avant de vous installer !";
verif_exterieur_notification.timeZone = [NSTimeZone defaultTimeZone];
verif_exterieur_notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication ]scheduleLocalNotification:verif_exterieur_notification];
【问题讨论】:
标签: objective-c xcode uilocalnotification apple-watch