0
배경에서 내 앱을 시작하는 원격 푸시 알림 (VoIP PushKit)을받을 때 로컬 알림을 트리거하려고합니다.iOS 10 앱이 백그라운드에있을 때 로컬 알림을 실행할 수있는 방법이 있습니까?
내 로컬 알림은 UNUserNotificationCenter에 보류중인 알림 배열로 표시됩니다.
[[UNUserNotificationCenter currentNotificationCenter] getPendingNotificationRequestsWithCompletionHandler:
^(NSArray<UNNotificationRequest *> * _Nonnull requests)
{
NSLog(@"Local notifications: %@",requests);
}];
"<UNNotificationRequest: 0x17162e500; identifier: 2A364020-3BA2-481B-9255-16EBBF2F4484, content: <UNNotificationContent: 0x1708e8080; title:test, subtitle: (null), body: test2, categoryIdentifier: missed, launchImageName: , peopleIdentifiers: (\n), threadIdentifier: , attachments: (\n), badge: 1, sound: <UNNotificationSound: 0x1704bfe60>, hasDefaultAction: YES, shouldAddToNotificationsList: YES, shouldAlwaysAlertWhileAppIsForeground: YES, shouldLockDevice: YES, shouldPauseMedia: NO, isSnoozeable: NO, fromSnooze: NO, darwinNotificationName: (null), darwinSnoozedNotificationName: (null), trigger: <UNTimeIntervalNotificationTrigger: 0x171624260; repeats: NO, timeInterval: 5.000000>>"
그러나 5 초 후에 나타나지 않습니다. UNTimeIntervalNotificationTrigger를 사용합니다.
응용 프로그램이 포 그라운드 일 때 로컬 알림을 성공적으로 호출했습니다. 나는 버튼을 눌러서 트리거를 호출함으로써 같은 기능을 사용한다.
iOS 앱이 백그라운드에있을 때 로컬 알림을 실행할 수있는 방법이 있습니까?