谷歌在什么情况下会返回这种格式的 utm_source=(not%20set)&utm_medium=(not%20set) 。
请让我知道是否有任何文档可以检查代码是否正常工作?
使用新的谷歌推荐 api。
try {
mReferrerClient = InstallReferrerClient.newBuilder(this).build();
mReferrerClient.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
switch (responseCode) {
case InstallReferrerClient.InstallReferrerResponse.OK:
// Connection established
ReferrerDetails response = null;
try {
response = mReferrerClient.getInstallReferrer();
refer = response.getInstallReferrer();
setData(refer, intent);
Log.e("refergoogle", refer);
response.getReferrerClickTimestampSeconds();
response.getInstallBeginTimestampSeconds();
mReferrerClient.endConnection();
} catch (Exception e) {
Crashlytics.logException(e);
}
break;
case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
// API not available on the current Play Store app
break;
case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE:
// Connection could not be established
break;
}
}
@Override
public void onInstallReferrerServiceDisconnected() {
// Try to restart the connection on the next request to
// Google Play by calling the startConnection() method.
}
});
} catch (Exception e) {
Crashlytics.logException(e);
}
为实时应用打印的日志是 E/original-reff: utm_source=(not%20set)&utm_medium=(not%20set)