[MOD-2562] WebDialog: Support passing intent flags to open method on Android
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-03-09T21:02:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.0 |
Components | n/a |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Ewan Harris |
Created | 2020-01-08T15:37:50.000+0000 |
Updated | 2020-03-09T21:02:36.000+0000 |
Description
Description
When using ti.webdialog in an OAuth2 flow, the webdialog needs to be closed after the flow is complete. Chrome Custom Tabs does not support closing the tab programatically, but we can achieve these by setting the following intent flags on the CustomTabsIntent
Intent.FLAG_ACTIVITY_NO_HISTORY
Intent.FLAG_ACTIVITY_NEW_TASK
We could do this by allowing a intentFlags
property to the open call, which accepts the flag options provided by Titanium.Android.FLAG_* constants
I initially though of having intentFlags as an array, but the Ti.Android.createIntent call accepts flags as a bitwise or, so I think I will match that. For example
PR here: https://github.com/appcelerator-modules/titanium-web-dialog/pull/14 Rather than add to workloads I'm going to leave this open and we can review and get it in at a later date
FR Passed. Verified the fix with module Ver. 2.0.0. Closing.