2016-11-16 83 views
6

節省調試時間,因爲我在搜索神祕應用程序崩潰後的2周內浪費了大量時間。事實證明,如果您向UNUserNotificationCenter添加很多o(請參閱回答以獲取更多詳細信息)通知請求,它會突然崩潰Springboard。我還沒有找到解決辦法,因爲相同的代碼適用於iOS 9及以下版本。您似乎無法像以前那樣批量添加通知請求。以下是我每次收到的崩潰(數百名應用用戶也是如此)。任何想法我可以做,而不是回到使用UILocalNotification s?當向UNUserNotificationCenter添加大量觸發器時,跳板崩潰

Incident Identifier: 17BC9D5B-AF74-4592-8427-038375C27AE7 
CrashReporter Key: a819553d1e72ee25a5ced9ddc79dbf00a7d3851f 
Hardware Model:  iPad5,3 
Process:    SpringBoard [2371] 
Path:    /System/Library/CoreServices/SpringBoard.app/SpringBoard 
Identifier:   com.apple.springboard 
Version:    50 (1.0) 
Code Type:   ARM-64 (Native) 
Role:    Foreground 
Parent Process:  launchd [1] 
Coalition:   com.apple.springboard [71] 


Date/Time:   2016-11-16 14:57:04.9159 +0400 
Launch Time:   2016-11-16 14:49:20.9981 +0400 
OS Version:   iPhone OS 10.0 (14A5309d) 
Report Version:  104 

Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Exception Note: EXC_CORPSE_NOTIFY 
Triggered by Thread: 13 

Filtered syslog: 
None found 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 GraphicsServices    0x0000000182396198 GSEventRunModal + 180 
6 UIKit       0x00000001869327c8 -[UIApplication _run] + 664 
7 UIKit       0x000000018692d534 UIApplicationMain + 208 
8 libdyld.dylib     0x00000001805305b8 start + 4 

Thread 1 name: com.apple.uikit.eventfetch-thread 
Thread 1: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 Foundation      0x000000018144d92c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96 
7 UIKit       0x000000018727af2c -[UIEventFetcher threadMain] + 136 
8 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
9 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
10 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
11 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 2: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 Foundation      0x0000000181481584 -[NSRunLoop(NSRunLoop) run] + 88 
7 UIKit       0x0000000186f73298 -[UIStatusBarServerThread main] + 840 
8 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
9 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
10 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
11 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 3: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 CoreBrightness     0x0000000190ec5d10 -[BrightnessSystemClientInternal main] + 1392 
7 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
8 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
9 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
10 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 4: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 SpringBoard      0x00000001001a0b00 0x1000f0000 + 723712 
6 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
7 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
8 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 5 name: com.apple.springboard.icongeneration 
Thread 5: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 SpringBoard      0x00000001001a0c00 0x1000f0000 + 723968 
6 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
7 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
8 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 6 name: com.apple.CoreMotion.MotionThread 
Thread 6: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 CoreFoundation     0x00000001809dd094 CFRunLoopRun + 112 
6 CoreMotion      0x0000000187762994 0x187702000 + 395668 
7 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
8 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
9 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 7 name: SBWiFiManager callback thread 
Thread 7: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 Foundation      0x0000000181481584 -[NSRunLoop(NSRunLoop) run] + 88 
7 SpringBoard      0x0000000100215e44 0x1000f0000 + 1203780 
8 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
9 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
10 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
11 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 8: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 HomeKit       0x00000001913e8974 -[_HMLocationHandler createLocationManager] + 508 
7 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
8 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
9 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
10 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 9: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 Foundation      0x000000018142ce3c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 
6 CoreBrightness     0x0000000190ec5d10 -[BrightnessSystemClientInternal main] + 1392 
7 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
8 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
9 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
10 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 10 name: CommonUtilities-WiFi-Thread 
Thread 10: 
0 libsystem_kernel.dylib   0x0000000180624194 mach_msg_trap + 8 
1 libsystem_kernel.dylib   0x0000000180624004 mach_msg + 72 
2 CoreFoundation     0x0000000180a61e8c __CFRunLoopServiceMachPort + 192 
3 CoreFoundation     0x0000000180a5faa8 __CFRunLoopRun + 1132 
4 CoreFoundation     0x000000018098f8d8 CFRunLoopRunSpecific + 444 
5 CoreFoundation     0x00000001809dd094 CFRunLoopRun + 112 
6 CommonUtilities     0x0000000182d10c20 0x182d0a000 + 27680 
7 Foundation      0x00000001815293ac __NSThread__start__ + 1024 
8 libsystem_pthread.dylib   0x00000001807079ec _pthread_body + 240 
9 libsystem_pthread.dylib   0x00000001807078fc _pthread_body + 0 
10 libsystem_pthread.dylib   0x0000000180704ef8 thread_start + 4 

Thread 11: 
0 libsystem_kernel.dylib   0x0000000180642a88 __workq_kernreturn + 8 
1 libsystem_pthread.dylib   0x000000018070549c _pthread_wqthread + 1440 
2 libsystem_pthread.dylib   0x0000000180704ef0 start_wqthread + 4 

Thread 12: 
0 libsystem_kernel.dylib   0x0000000180642a88 __workq_kernreturn + 8 
1 libsystem_pthread.dylib   0x000000018070549c _pthread_wqthread + 1440 
2 libsystem_pthread.dylib   0x0000000180704ef0 start_wqthread + 4 

Thread 13 name: Dispatch queue: com.apple.frontboard.sqlite.database 
Thread 13 Crashed: 
0 libsystem_kernel.dylib   0x0000000180642014 __pthread_kill + 8 
1 libsystem_pthread.dylib   0x00000001807094f0 pthread_kill + 112 
2 libsystem_c.dylib    0x00000001805b64b8 abort + 140 
3 libsystem_malloc.dylib   0x0000000180686a38 _nano_vet_and_size_of_live + 0 
4 libsystem_malloc.dylib   0x0000000180687db8 nano_free + 220 
5 libsqlite3.dylib    0x000000018103a5f8 0x180f95000 + 677368 
6 libsqlite3.dylib    0x0000000180fbac9c 0x180f95000 + 154780 
7 libsqlite3.dylib    0x0000000180fe6074 0x180f95000 + 331892 
8 libsqlite3.dylib    0x0000000180fd70b0 sqlite3_step + 588 
9 FrontBoard      0x0000000190312ee4 __79-[_FBSqlitePreparedSimpleStatement executeWithBindings:resultRowHandler:error:]_block_invoke + 424 
10 libdispatch.dylib    0x00000001804fd784 _dispatch_client_callout + 16 
11 libdispatch.dylib    0x000000018050aca4 _dispatch_barrier_sync_f_invoke + 84 
12 FrontBoard      0x000000019031e0d0 -[FBSqliteDatabaseConnection performSyncWithDatabase:] + 80 
13 FrontBoard      0x0000000190312cbc -[_FBSqlitePreparedSimpleStatement executeWithBindings:resultRowHandler:error:] + 148 
14 FrontBoard      0x000000019035a4d8 -[FBSqliteApplicationDataStoreRepository _dbQueue_executeStatement:bindings:resultRowHandler:error:] + 80 
15 FrontBoard      0x000000019035a538 -[FBSqliteApplicationDataStoreRepository _dbQueue_executeStatement:bindings:resultRowHandler:] + 72 
16 FrontBoard      0x0000000190359374 -[FBSqliteApplicationDataStoreRepository _dbQueue_objectForKey:forApplication:] + 504 
17 FrontBoard      0x0000000190357a34 __81-[FBSqliteApplicationDataStoreRepository objectForKey:forApplication:withResult:]_block_invoke.44 + 40 
18 libdispatch.dylib    0x00000001804fd784 _dispatch_client_callout + 16 
19 libdispatch.dylib    0x000000018050aca4 _dispatch_barrier_sync_f_invoke + 84 
20 FrontBoard      0x0000000190357990 -[FBSqliteApplicationDataStoreRepository objectForKey:forApplication:withResult:] + 92 
21 FrontBoard      0x000000019038a5cc -[FBApplicationDataStoreInProcessRepositoryClient objectForKey:forApplication:withResult:checkPrefetch:] + 528 
22 FrontBoardServices    0x00000001825c3e3c __40-[FBSApplicationDataStore objectForKey:]_block_invoke + 112 
23 libdispatch.dylib    0x00000001804fd784 _dispatch_client_callout + 16 
24 libdispatch.dylib    0x0000000180508f80 _dispatch_block_invoke_direct + 376 
25 BaseBoard      0x00000001825415a8 -[NSObject(BaseBoard) bs_performSynchronously:timeout:] + 144 
26 FrontBoardServices    0x00000001825c3d7c -[FBSApplicationDataStore objectForKey:] + 224 
27 FrontBoardServices    0x00000001825c4044 -[FBSApplicationDataStore safeObjectForKey:ofType:] + 32 
28 FrontBoardServices    0x00000001825c41d4 -[FBSApplicationDataStore archivedObjectForKey:] + 64 
29 FrontBoardServices    0x00000001825c4314 -[FBSApplicationDataStore safeArchivedObjectForKey:ofType:] + 32 
30 UserNotificationsServer   0x000000019c52169c -[UNSPendingNotificationRepository _pendingNotificationDictionariesForBundleIdentifier:] + 140 
31 UserNotificationsServer   0x000000019c5219d0 -[UNSPendingNotificationRepository setPendingNotificationRecords:forBundleIdentifier:] + 72 
32 UserNotificationsServer   0x000000019c5249b4 -[UNSLocalNotificationClient _setPendingNotificationRecords:] + 500 
33 UserNotificationsServer   0x000000019c5235c4 -[UNSLocalNotificationClient addPendingNotificationRecords:] + 1124 
34 UserNotificationsServer   0x000000019c51d648 -[UNSNotificationSchedulingService _queue_addPendingNotificationRecords:forBundleIdentifier:] + 84 
35 UserNotificationsServer   0x000000019c51c6b0 __108-[UNSNotificationSchedulingService addPendingNotificationRecords:forBundleIdentifier:withCompletionHandler:]_block_invoke + 36 
36 libdispatch.dylib    0x00000001804fd7c4 _dispatch_call_block_and_release + 24 
37 libdispatch.dylib    0x00000001804fd784 _dispatch_client_callout + 16 
38 libdispatch.dylib    0x000000018050b880 _dispatch_queue_serial_drain + 928 
39 libdispatch.dylib    0x0000000180500f6c _dispatch_queue_invoke + 652 
40 libdispatch.dylib    0x000000018050bd7c _dispatch_queue_override_invoke + 360 
41 libdispatch.dylib    0x000000018050d718 _dispatch_root_queue_drain + 572 
42 libdispatch.dylib    0x000000018050d478 _dispatch_worker_thread3 + 124 
43 libsystem_pthread.dylib   0x00000001807053f8 _pthread_wqthread + 1276 
44 libsystem_pthread.dylib   0x0000000180704ef0 start_wqthread + 4 

UPDATE:它似乎並沒有根據通知的具體數量。我碰巧經常觸發它,因爲當應用程序在後臺(推送通知,應用程序刷新,應用程序轉到後臺等)時,我已經註冊了大約30到40個通知 - 由於異步添加這些警報需要更長的時間,該應用程序將同時放棄其擁有的後臺任務標識符。我已經在下面詳細解釋了這一點,以及解決方法。

此漏洞已被Apple確認並標記爲之前報告的錯誤的副本。我希望這個問題得到解決,因爲它會在某些邊緣情況下繼續引發問題,例如應用程序在後臺啓動並在不久之後超時(在後臺內容刷新期間)。

+0

有趣。感謝分享。關於多少是「很多」? – shallowThought

+0

30到40之間的任何內容。基本上,您必須按下電源按鈕以關閉屏幕,重新啓動應用程序並重新啓動,然後嘗試刪除並添加更多通知。幾次後,你會看到崩潰。我通過在添加通知後添加runloop等待來修復它,並且只有在完成添加通知後才釋放鎖定。它似乎是一個iOS的錯誤,但花了我一段時間找出一個解決方法。 – strangetimes

+0

@shallowThought我已經用一個解決方法更新了這個問題。我對蘋果工程師的監督感到震驚。他們聲稱WWDC期間的功能平價,但新的UNUserNotificationCenter甚至不讓我們像我們以前那樣批量分配通知(而不是循環20次需要註冊的通知)。 – strangetimes

回答

2

我找到了一個解決辦法

本質(已經登錄與蘋果的錯誤ID 29286162錯誤),似乎跳板崩潰,如果該UNUserNotificationCenter忙添加通知和其還沒有完成這樣做,當用戶按下主頁按鈕返回到SpringBoard。顯然,線程正在死亡(好吧,可能是因爲我不得不放棄後臺任務標識符,希望UNUserNotificationCenter會愉快地在自己的系統提供的後臺線程中使用傳遞的請求),而將正在進行的異步操作在空洞,導致跳板最終崩潰。我現在只是在後臺任務(UIBackgroundTaskIdentifier)中產生一個線程,並保留它直到完成添加所有通知。這導致零事故 - 所有先前抱怨過的用戶也證實了這一點。

// arrTasksToSchedule -> holds UNNotificationRequests to add 

    __block NSInteger volatile processedAlerts = 0; 
    NSInteger totalToProcess = [arrTasksToSchedule count]; 
    UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; 
    for (UNNotificationRequest* notifRequest in arrTasksToSchedule) { 
    [center addNotificationRequest:notifRequest withCompletionHandler:^(NSError * _Nullable error) { 
     processedAlerts++; 
    }]; 
    } 

    // Let the runloop carry on processing events till we're done 
    while (processedAlerts != totalToProcess) { 
    [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; 
    } 

    // Okay we're done, and can now let go of our held UIBackgroundTaskIdentifier 

文檔隻字未提後臺任務,在後臺任務或任何使用UNUserNotificationCenter多線程等做的危險我只能假設他們沒有意識到大多數應用程序做他們的通知,註冊在自己的應用程序發送到後臺(或在後臺內容刷新推送通知期間)。

由於Springboard崩潰 - 應用程序本身沒有生成崩潰報告。用戶不停地抱怨,這是你一無所知的非常困難的情況之一。我希望這能節省很多人的頭痛。

UPDATE:雖然現在的代碼上面的工作就好了,我做了一個稍微修飾的while循環的條件,不得以的情況下滿足用戶關閉應用程序按下電源按鈕來切換屏幕關閉。在這種情況下,runloop顯然沒有任何可處理的內容,並且會被阻塞。相反,下面的伎倆:

// Wait in a run loop 
while (processedAlerts != totalToProcess) { 
    [NSThread sleepForTimeInterval:0.15]; 

    // Don't use the following, as it will stop firing in case 
    // the runloop has no events (such as touch events) firing 
    // [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; 
} 
+0

我認爲這個問題比以前的想法還要糟糕。當我的應用程序處於前臺時,我能夠觸發跳板崩潰。我(當前!)每次用戶啓動計時器或跳過進入下一個時間段時,都會爲未來的Pomodoro計時器配置64個通知。所有異步回調完成大約需要6秒鐘的時間!通過反覆點擊跳過,並刪除和創建越來越多的通知,我可以得到一個跳板崩潰。很明顯,我需要在我的應用程序中變得更聰明,但問題不僅僅在於後臺執行。 –

+0

@GeoffHackworth我敢肯定,這已經超過一個月了,而且我仍然*發生火災,全部與通知有關。我已經設法讓應用程序不會崩潰,但通過這麼做,有大量警報的「重度用戶」不再能夠使用該應用程序,這很讓人傷心。我也沒有在10.2測試版中看到這個問題,所以我會敦促你向蘋果公司提供一個雷達,以便它們能夠繼續。提交的錯誤越多,看到修復的機率就越高。 – strangetimes

+0

@GeoffHackworth值得指出的是,您註冊的警報越多,看起來越慢,註冊時間越長。這就是爲什麼我以最多25到30條警報爲限(因此用戶有更多的警報受到影響),但超過30條警報的應用程序和應用程序需要太長的時間才能註冊警報。 – strangetimes

3

近日在Todoist的人發佈的信息顯示,他們已經圍繞跳板崩潰工作的更新(11.2.7)。

Todoist 11.2.7 Release Notes

後不久,蘋果iOS 10.2釋放。從那以後,我開始從我的應用程序的用戶那裏收到報告已經解決的錯誤。然而,在Todoist的傢伙好奇的是如何解決問題的工作,我接觸了他們,這是他們的領導iOS開發者與我分享:

嗨俊傑,

是的,你說得對。 iOS 10中的跳板實際上是與調度本地用戶通知相關的 。該問題實際上是在iOS 10.2上修復的 ,但我們也通過 對iOS 10.1進行了修復,對用戶通知進行了必要的更改。之前,我們在加入 所有請求,而不管他們是否已經加入了,我們開始 與已經計劃對它們進行比較,只是添加那些 不同:

讓requestsToAdd = requestsToSchedule.filter {pendingRequests!包含($ 0)}

希望這會有所幫助。

努諾