android - 是否应该从 Playstore 下载应用程序以跟踪安装情况?或者有没有其他方法可以进行安装跟踪测试
问题描述
我根据 docs.branch.io 集成和配置了 branch.io SDK,并从 branch.io 仪表板创建了一个链接以跟踪安装,但我只能看到点击计数器和应用程序重新打开计数器,但不显示安装计数器。清单.xml
<meta-data android:name="io.branch.sdk.BranchKey" android:value="my_live_key" />
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="my_test_key" />
<!-- Branch testing (TestMode "true" to simulate fresh installs on dev environment) -->
<meta-data android:name="io.branch.sdk.TestMode" android:value="false" />
<!-- Branch install referrer tracking -->
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<activity
android:name=".activities.MainActivity"
android:launchMode="singleTask"
android:theme="@style/AppTheme.NoActionBar.Splash"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Branch URI scheme -->
<intent-filter>
<data android:scheme="goalwise" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</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:scheme="https" android:host="xjgf5.app.link" />
<data android:scheme="https" android:host="xjgf5-alternate.app.link" />
</intent-filter>
应用类
@Override
public void onCreate() {
super.onCreate();
// Initialize the Branch object
Branch.getAutoInstance(this);
}
MainActivity.java
@Override
protected void onStart() {
super.onStart();
Branch.getInstance().initSession(new Branch.BranchReferralInitListener() {
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
if (error == null) {
Log.i("BRANCH SDK", referringParams.toString());
// Retrieve deeplink keys from 'referringParams' and evaluate the values to determine where to route the user
// Check '+clicked_branch_link' before deciding whether to use your Branch routing logic
} else {
Log.i("BRANCH SDK", error.getMessage());
}
}
}, this.getIntent().getData(), this);
IntegrationValidator.validate(MainActivity.this);
}
解决方案
请更改清单文件中的以下行:
<meta-data android:name="io.branch.sdk.TestMode" android:value="false" />
至
<meta-data android:name="io.branch.sdk.TestMode" android:value="true" />
这将模拟安装,即使安装不是从 Play 商店进行的,Branch 也会在仪表板上报告。这称为测试模式。更多信息在这里。
推荐阅读
- c# - 来自 .NET Core 应用程序的 SOAP Web 服务调用
- r - UpSetR dataframe as input counts zeros
- python - 一种算法,用于找到与一组等效数字集合中的最少数字匹配的数字集合
- javascript - “加载时未定义加载”
- sql - 使用 laravel 创建连接表
- typescript - 将对象转换为返回相同对象的函数并继续转换
- c - 是否可以不使用任何数组将整数的值分配给指定地址?
- ios - Swift - 将目标添加到子视图内的 UIButton
- regex - How can I find and replace a date token using sed, backreference, and subcommand?
- c++ - 如何在派生类中正确覆盖具有不同参数的函数?