Closed Bidou44 closed 3 years ago
I'm the author of the referenced SO thread and would love to see a fix to this issue. The bypass I'm using is not always dependable.
@aranmohyeddin you can try adding a timeout as listed above. Yes, it's bogus, but it can get you working again. I've had to up my timeout to 750ms over the various {N} updates to dependably bypass this error.
@dlcole Well, as written it's not a good solution, we have put more than 1 second for the timeout and checking the logs shows that the problem still happens for some user... could someone fix this properly? Unfortunately, I'm not a iOS developer....
I hit this problem again today, trying to display a confirmation prompt after selecting a contact :-(. So, I debugged it further and developed a fix, replacing some deprecated iOS APIs with newer ones. I'll post a pull request in the near future.
Sounds good, not sure though that the owner is still active, so it may never be merged :(
Hi @firescript, could you create a new npm release with that fix?
Hi @Bidou44 - I just bumped the npm release version.
@firescript @dlcole Thank you so much for your help guys. It's working like a charm! I think that this PR is also fixing other reported issues
When selecting a contact, I would like to open a custom view if there are multiple addresses registered for that contact.
So the code looks like this
On iOS, this always throws an exception, because the contact frame is not completely closed when showing my custom view. A dirty workaround is to put a timeout() to ensure that the contact frame is correctly closed, but this is really not a good solution. Putting a value of 1 sec for the timeout seems to make the whole thing work 90% of the time, which is clearly insufficient.
So it would be good to be notified when the contact window closed. If I'm not wrong, this is a native functionality of iOS (when you open the contact window, you can pass a callback that will be called when the frame is completely closed).
This Stackoverflow thread explains this problem quite well: https://stackoverflow.com/questions/55769425/nativescript-javascript-modal-dialog-fails-with-viewhierarchy-error-on-ios