Merge branch 'sungazer-io-master' into develop

This commit is contained in:
Lorenzo Pichilli 2022-04-15 23:25:38 +02:00
commit 104eeab1cd
2 changed files with 11 additions and 2 deletions

View File

@ -72,6 +72,9 @@ public class ChromeSafariBrowserManager implements MethodChannel.MethodCallHandl
if (CustomTabActivityHelper.isAvailable(activity)) {
intent = new Intent(activity, !isSingleInstance ? ChromeCustomTabsActivity.class : ChromeCustomTabsActivitySingleInstance.class);
intent.putExtras(extras);
if ((Boolean) options.get("noHistory")) {
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
}
activity.startActivity(intent);
result.success(true);
return;

View File

@ -38,6 +38,9 @@ class AndroidChromeCustomTabsOptions
///Set to `true` to launch the Android activity in `singleInstance` mode. The default value is `false`.
bool singleInstance;
///Set to `true` to launch the Android intent with the flag `FLAG_ACTIVITY_NO_HISTORY`. The default value is `false`.
bool noHistory;
AndroidChromeCustomTabsOptions(
{this.addDefaultShareMenuItem = true,
this.showTitle = true,
@ -46,7 +49,8 @@ class AndroidChromeCustomTabsOptions
this.instantAppsEnabled = false,
this.packageName,
this.keepAliveEnabled = false,
this.singleInstance = false});
this.singleInstance = false,
this.noHistory = false});
@override
Map<String, dynamic> toMap() {
@ -58,7 +62,8 @@ class AndroidChromeCustomTabsOptions
"instantAppsEnabled": instantAppsEnabled,
"packageName": packageName,
"keepAliveEnabled": keepAliveEnabled,
"singleInstance": singleInstance
"singleInstance": singleInstance,
"noHistory": noHistory
};
}
@ -74,6 +79,7 @@ class AndroidChromeCustomTabsOptions
options.packageName = map["packageName"];
options.keepAliveEnabled = map["keepAliveEnabled"];
options.singleInstance = map["singleInstance"];
options.noHistory = map["noHistory"];
return options;
}