Closed EdwinJr13 closed 4 years ago
Do we have any update on the fix?
Any update? because i face same error.
same issue
Have the same issue. I use the Banner from SwiftUI so I don't pass the UIViewController, banner shows on the main window.
I found my case reason. The application tries to show banner when a user cancels Google/Fb authentification, so the current scene has foreground inactive state and NotificationBanner couldn't retrieve the window.
It happens here:
if #available(iOS 13.0, *) {
return UIApplication.shared.connectedScenes
.first { $0.activationState == .foregroundActive }
.map { $0 as? UIWindowScene }
.map { $0?.windows.first } ?? UIApplication.shared.delegate?.window ?? nil
}
Dirty workaround - show notification with delay. Or add support for pending notifications and show notifications depends on application state. But it isn't the question for the library.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed due to inactivity.
please check this from author https://github.com/Daltron/NotificationBanner/pull/295#issuecomment-623175359
had the same malfunction, ios 13.4.1, a very common scenario
When I try to display the notification on a real device it shows that error:
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
On this line:
self.frame = bannerPositionFrame.startFrame
Help please.