ChromeCustomTabs uses Chrome, SafariViewController uses Safari. Is there an alternative for Huawei (Huawei Browser). Can I use Huawei Browser as an in-app browser?
Asked
Active
Viewed 821 times
1 Answers
4
Can I use Huawei Browser as an in-app browser?
Yes you can,Huawei browsers support CustomTabs.
You can start the Custom Tab using either of the following methods:
1.Use the public interfaces provided by the support package. The details are as follows:
The Maven depends on the support package.
dependencies {
...
compile 'com.android.support:customtabs:23.3.0'
}
Then use the CustomTabIntent.Builder of the support package to start the build.
String url = ¨https://paul.kinlan.me/¨;
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.intent.setPackageName(“com.huawei.browser”);
customTabsIntent.launchUrl(this, Uri.parse(url));
customTabsIntent.intent.setPackageName(“com.huawei.browser”);
Indicates to start the Custom Tab of Huawei browser. You can also change the package name of another browser to start the Custom Tab of another browser.
2.Start the Huawei browser Custom Tab by starting the intent.
String url = ¨https://paul.kinlan.me/¨;
Intent customTabsIntent = new Intent(Intent.ACTION_VIEW);
customTabsIntent.setData(Uri.parse(url))) ;
Bundle bundle = new Bundle();
bundle.putBinder(EXTRA_SESSION, null);
customTabsIntent.putExtras(bundle);
customTabsIntent.intent.setPackageName(“com.huawei.browser”);
startActivity(customTabsIntent);

zhangxaochen
- 32,744
- 15
- 77
- 108
-
Is there a way to do it using Flutter? – Cb11 Feb 13 '23 at 09:32