[英]UNUserNotificationCenter didReceive response not called when app is terminated
[英]UNUserNotificationCenterDelegate didReceive response for Local Notifications not called when app is not running
我正在嘗試使用新的UserNotifications框架進行本地通知。 單擊/打開通知時,我將用戶重定向到其他ViewController。 UNUserNotificationCenterDelegate didReceive
方法未正確處理該通知。
當通知位於前台,然后單擊它時,它會重定向到右視圖控制器,但是,當應用程序關閉並打開通知時,將啟動該應用程序,但是,將顯示主視圖控制器。
問題實際上不是didReceive
,而是問題在於didReceive
的過渡方式,這是因為方法在完成之前就返回了。
我正在以編程方式模擬正常的用戶流。 問題在於, tableview:didselectRowAt
在執行其內部的performSegue
方法之前tableview:didselectRowAt
返回。
我最終手動加載了VC,然后顯式調用UInavigationController:pushViewController(vc:animated:)
將它們壓入導航堆棧。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.