[MOD-2654] WebDialog: Support close event on Android
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Web Dialog |
Labels | android |
Reporter | Ewan Harris |
Assignee | Aakash Jain |
Created | 2020-06-25T09:52:04.000+0000 |
Updated | 2021-01-15T17:50:53.000+0000 |
Description
In the webdialog module currently a developer can detect the closing of a webdialog using the
close
event. Currently Android has no equivalent for this event currently, however it is possible to support this
Community PR: https://github.com/appcelerator-modules/titanium-web-dialog/pull/19
Note from customer testing the PR. As Chrome is hardcoded as the package name [here](https://github.com/appcelerator-modules/titanium-web-dialog/pull/19/files#diff-ec97b2a8e27b236611c64d3d1ac0a50bR91) the
close
event only works is Chrome is set as the default browser. Setting another browser (e.g. Samsung Browser or Edge) as the default causes the event to not be firedThe[PR#19](https://github.com/appcelerator-modules/titanium-web-dialog/pull/19)is fine per the code review. Also tested the close event functionality on sample application in this module. The close event is caught perfectly fine as required. However, if we call open method immediately after creating the object of the web-dialog module, then close event is not triggered for the first time. IMO, this scenario(calling open right after creating object) is very much possible hence this problem should be fixed as well. This would need some time to identify the best possible solutions for the same. [~ssingh]
As mentioned in: https://github.com/appcelerator-modules/titanium-web-dialog/pull/19#issuecomment-616761617 It needs a "warm-up" time (at least thats what they've called it in a stackoverflow ticket I think) to get ready. I'm not happy with the PR but I wasn't sure who to implement it correctly
[~gmathews]/[~aajain] One further note from the customer on this, is there anything that we could possibly do to differentiate between the two, or would it have to be handled by the app code?
The close event is being caught upon user close and deep-link close. Tested the same on the code: (https://gist.github.com/ewanharris/16909adfbfb43978858d5e7169d1bc9c ). However, debugged the code and found no information is there in close event callback that can help in distinguish between the two. Also, looked into the CustomTabs apis which are being used but nothing useful for us in that. [~gmathews] can share incase he has any updates on the ticket.