2017-05-24 2 views
0

제 iPhone 응용 프로그램에서 UILocalNotification을 만듭니다. Apple Watch에서 UILocalNotification을 동기화하는 방법을 알고 싶습니다. 즉, 알림이 iPhone에 표시 될 때 Watch에 표시되도록하는 것입니다.UILocalNotification을 Watch에 동기화하십시오.

그것은 내 UILocalNotification (이 알림은 91 secondes에 나타 나는 전화에 표시하고보고 싶습니다)입니다 :

 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]; 

답변

0

당신이 이것을 달성하기 위해 아무것도 할 필요가 없습니다. 시스템은 통지를 표시 할 장치를 자동으로 결정합니다. iPhone이 잠겨 있고 시계가 손목에있는 경우 자동으로 시계에 알림을 받아야합니다. 또한 iPhone의 시계 응용 프로그램에서 앱에 대한 알림이 켜져 있고 시계가 방해 금지 모드에 있지 않은지 확인하십시오.

+0

ok UIlocalNOtification이 아이폰에 나타날 때 정적 알림 인터페이스를 만드는 방법은 무엇입니까? 감사합니다. –

+0

앱에 알림 확장 프로그램 타겟을 추가해야합니다. [이 튜토리얼] (https://code.tutsplus.com/tutorials/ios-10-creating-custom-notification-interfaces--cms-27251) –

+0

알림 확장을 살펴 보시겠습니까? 조심해? 튜토리얼 –

관련 문제