我正在开发一个打开受信任的网络活动的 android 应用程序。但出于分析原因,我想跟踪在TWA中打开的url。他们有什么方法可以跟踪受信任的网络活动中的打开 URL吗?我为 TWA 编写的代码仅在 android 清单中。我只是复制粘贴我的 android 清单文件。看看吧。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.dummy.work">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/appName"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.LauncherActivity"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name="android.support.customtabs.trusted.
LauncherActivity"
android:label="@string/appName">
<intent-filter>
<category
android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data
android:host="beta.turms.in"
android:scheme="https" />
<data
android:host="beta.turms.in"
android:pathPrefix="/"
android:scheme="https" />
</intent-filter>
<meta-data
android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="@string/launchUrl" />
<meta-data
android:name="android.support.customtabs.trusted.
STATUS_BAR_COLOR"
android:resource="@color/colorPrimary" />
</activity>
<meta-data
android:name="use_browser_on_chromeOS"
android:resource="@bool/useBrowserOnChromeOS" />
<meta-data
android:name="asset_statements"
android:resource="@string/assetStatements" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
<service
android:name="android.support.customtabs.trusted.
TrustedWebActivityService"
android:enabled="@bool/enableNotification"
android:exported="@bool/enableNotification">
<intent-filter>
<action
android:name="android.support.customtabs.trusted.
TRUSTED_WEB_ACTIVITY_SERVICE" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name=".Firebase.MyFirebaseMessagingService">
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.firebase.messaging.
default_notification_color"
android:resource="@color/colorAccent" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
</application>
</manifest>