我正在尝试集成Facebook Events SDK
来跟踪我的Android应用的应用安装。由于这仍处于测试阶段,因此每次进行测试时,我都会执行以下步骤:
在快速连续安装/重新安装应用程序时,AppLinkData
始终返回null。像这样在应用程序内部引用AppLinkData:
AppLinkData.fetchDeferredAppLinkData(this, new AppLinkData.CompletionHandler() {
@Override
public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
Log.v(this.toString(), "Inside deferred app link data.");
if(appLinkData != null) {
Log.v(this.toString(), "Ref: " + appLinkData.getRef());
Log.v(this.toString(), "URI: " + appLinkData.getTargetUri());
Log.v(this.toString(), "Promo code: " + appLinkData.getPromotionCode());
Log.v(this.toString(), "Referrer data: ");
Log.v(this.toString(), "Logging events for facebook install.");
Bundle appBundle = new Bundle();
appBundle = new Bundle(); //it is null. might need to be initialized.
appBundle.putString("ITEM_ID", "ITEM_facebook_install");
appBundle.putString("app_install", "app_install");
if(appLinkData.getRef() != null) {
appBundle.putString("Ref", appLinkData.getRef());
}
if(appLinkData.getTargetUri().toString() != null) {
appBundle.putString("URI", appLinkData.getTargetUri().toString());
}
if(appLinkData.getPromotionCode() != null) {
appBundle.putString("Promo", appLinkData.getPromotionCode());
}
ebFacebookEvents.logFBEvent("app_install", appBundle);
} else {
Log.e(this.toString(), "AppLinkData is null");
}
}
});
但是,有时应用程序链接数据返回深层链接URL以及其他参数。但是,当appLinkData返回null时,在几乎所有此类情况下,facebook分析页面仅显示“ App Launch”事件,而不显示“ App Install”事件。
我的问题:
1.为什么快速安装/重新安装事件注册为应用程序启动事件,而不注册为应用程序安装事件?是否有一个“冷静期”?
2.任何深入了解这一点将最有帮助。