Problem Description
When you have a delay on an alert, with persistent set to true, you will experience a weird glitch when waiting for the alert and you pull down the phone notification window. The alert will appear behind the notification window, when you close the notification window, the alert will disappear. This doesn't happen with iOS 8.x
Steps to reproduce
1. Create a new mobile project Classic Titanium
2. Paste this code into app.js:
var win = Ti.UI.createWindow({backgroundColor:'white'});
var dateBaseView = Titanium.UI.createView({
width : "80dip",
height : "40dip",
backgroundColor : 'green'
});
dateBaseView.addEventListener("click", showDatePicker);
win.add(dateBaseView);
function showDatePicker() {
setTimeout(function() {
var dialog = Titanium.UI.createAlertDialog({
title : "Test Bug",
message : "Testing",
persistent : true,
buttonNames : ["OK"]
});
dialog.show();
}, 4000);
}
win.open();
3. Run it in iOS 7 (either device or sim).
4. Click on the green square
5. Drop down the phone notification window from the top of the screen.
6. wait until the alert appears behind the current window.
7. Close the Window
8. You will see the alert dissapear.
Extra info
This doesn't happen with iOS8.
There is alternative ways to reproduce this, as well:
1. open app and tap on the green view.
2. wait for the alert to appear.
2. Double tap device home button immediately to go the recent running apps view.
3. tap the app from recent running apps list to make it foreground again.
The issue appears.
Looks like something to do with the way iOS 7 handles window stack.
Pull pending master- https://github.com/appcelerator/titanium_mobile/pull/6644
Verified fixed, using: Titanium SDK 4.0.0.v20150303161012 Studio 4.0.0.201502171827 CLI 3.4.2-rc4 Xcode 6.2b5 Alert is not dismissed when closing notification center, as expected.