mateuszmackowiak / NativeDialogs

Adobe Air Native Extension for mobile native dialogs (IOS,Andoid) - Toast, Text Input dialog, Progress dialog, Alert dialog, multi single choice dialog + DatePicker dialog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NativeAlertDialog freeze on iOS

Neverbirth opened this issue · comments

My app freezes when calling NativeAlertDialog with extra labels.

I've tried debugging it, but I haven't managed to find a reason for the problem, only that it freezes when calling alert show...

After more testing, the problem is not caused by having extra labels. if I remove them I still get the lock.

I haven't found the root cause of the problem yet... before the lock other progress popup and alert are shown (the progress dialog is disposed).

commented

Try instaling a free "Console" app, call Your'e code that makes the error and see if there is any response in the console.
If You are on mac type: "tail -f /var/log/system.log" in the terminal and look for answers

I do have a console installed, and that's how I confirmed it's freezing when calling alert show, the following line does not get to be called..

The old Native Alerts ANE could also freeze an app when displaying alerts and progress dialogs, and it was because of a reference not correctly released, but in this case, I wasn't able to see where the problem lies... guess I'll look again later today or tomorrow.

OK, the freeze is not happening with my iOS 6.x devices, only with the 5.1 one. And it's also happening with the old Native Alerts ANE.

So thought the problem could be with AIR 3.6 itself, recompiled NativeDialogs without linking with shared libraries, but it's making my app to crash before fully loaded. My project is compiled with Windows, I don't know if compiling with Mac, or specifying a custom SDK instead of the built-in one could solve the problem. I thought that maybe it's using some framework not in the built-in SDK and that should be added to platformoptions.xml, but if so, shouldn't the AIR project compilation fail?

Went ahead and thought: maybe the alert is being shown in some background thread or similar with latest AIR version under some circumstances? so changed

[alert show];

to

[alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];

Rather strange, but it works.

I've found out this problem has something to do with the click handler and when it's dispatched.

Been reading latest AIR 3.7 beta release notes, and saw this in the list of known issues:

3506238 - [iOS] An AIR button may remain in MouseOver state, instead of returning to default state when a native dialog or modal view displayed using an ANE is dismissed

I'd say this may be the reason of the freeze.

When I call the NativeAlertDialog.dispose function , but the alert dialog is still show。
Can you add a "static function dispose()" in NativeAlertDialog? And the static dispose function can dispose all the Alert Dialogs.

commented

All dialogs have a hide() method. But my bad that the dispose method does not close the dialog. I will fix it at the next commit.