Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2562] WebDialog: Support passing intent flags to open method on Android

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2020-03-09T21:02:36.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.0
Componentsn/a
Labelsn/a
ReporterEwan Harris
AssigneeEwan Harris
Created2020-01-08T15:37:50.000+0000
Updated2020-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

Comments

  1. Ewan Harris 2020-01-08

    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
       webdialog.open({
       	url,
       	intentFlags: Ti.Android.FLAG_ACTIVITY_NO_HISTORY | Ti.Android.FLAG_ACTIVITY_NEW_TASK
       });
       
  2. Ewan Harris 2020-01-08

    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
  3. Lokesh Choudhary 2020-02-25

    FR Passed. Verified the fix with module Ver. 2.0.0. Closing.

JSON Source