我有一个用例,我们的内部移动网站上有一个按钮,允许用户深入链接到配套的Android应用。
我正在使用以下代码显示内部网页
final CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(Color.BLUE);
final CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse("https://www.internal.research.com/androidapp"));
此页面包含以下表单(和按钮):-
<form action="sandpit://android-app">
<input type="submit" value="Open the app" />
</form>
使用adb
可以触发深层链接。
当我单击上面的表单按钮时,我的日志将显示
2018-10-23 15:44:34.649 13033-13033/? I/chromium: [INFO:CONSOLE(0)] "Mixed Content: The page at 'https://www.internal.research.com/androidapp' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'sandpit://android-app'. This endpoint should be made available over a secure connection.", source: https://www.internal.research.com/androidapp (0)
2018-10-23 15:44:34.676 13033-13033/? I/chromium: [INFO:CONSOLE(0)] "Navigation is blocked: sandpit://android-app?", source: https://www.internal.research.com/androidapp (0)
如何获得单击网页表单按钮以深层链接到我的Android应用程序?