[英]Is their any way to differentiate package installation from adb command and from playstore?
[英]Should the app be downloaded from Playstore to track installs? or is there any other way to do the installation tracking test
我已根据docs.branch.io集成并配置了branch.io SDK,并从branch.io仪表板创建了一个链接来跟踪安装,但是我只能看到单击计数器和应用程序重新打开计数器,但未显示安装计数器。 Manifest.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会在信息中心上报告安装情况。 这称为测试模式。 更多信息在这里 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.