AJNotificationView icon indicating copy to clipboard operation
AJNotificationView copied to clipboard

Moving to another view while a notification is being shown bugs it!

Open m4mazzotti opened this issue 11 years ago • 4 comments

If you push a second view while the first view is displaying a AJNotification will make it stop working. No other AJNotification will be shown until you restart the app.

The only work around I found is to use: hideCurrentNotificationViewAndClearQueue

m4mazzotti avatar Apr 28 '13 00:04 m4mazzotti

I have this same issue. I use the notification view to let users know when the app loses network communication. I'll show a sticky notification view when communication is lost, and then hide and show a transitory one when communication is restored. If another view is showing modally (e.g., on iphone) over the view hosting the sticky notification view when network communication is restored, notification views will stop working.

The problem seems to be that the animation that hides the current notification is not "finished" and so none of the code in the "finished" block of the hide method's animation is ever called, leaving the queue in an invalid state.

image

I think a fix would be to see if the current instance's parentView is attached to the window, and if not, skip all the animation stuff and just do the cleanup work so the next notification can get processed.

mikee179 avatar May 11 '13 21:05 mikee179

My workaround is to use this, to show the notification in the application's root window, rather than the current view:

[AJNotificationView showNoticeInView:[[[UIApplication sharedApplication] delegate] window]...

mflint avatar Jul 11 '13 08:07 mflint

Unfortunately, if I use AppDelegate.window, the alert appears as if the device were in portrait orientation even though it is in landscape. Doesn't look great. :P

I think in my case I will just disable the queue as I don't really need to display more than the most recent alert.

devios1 avatar Sep 11 '13 21:09 devios1