|
19 | 19 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.ANALYTICS_USER_PROPERTIES;
|
20 | 20 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.APP_ID;
|
21 | 21 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.APP_VERSION;
|
| 22 | +import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.APP_BUILD; |
22 | 23 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.COUNTRY_CODE;
|
23 | 24 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.INSTANCE_ID;
|
24 | 25 | import static com.google.firebase.remoteconfig.RemoteConfigConstants.RequestFieldKey.INSTANCE_ID_TOKEN;
|
|
41 | 42 | import android.util.Log;
|
42 | 43 | import androidx.annotation.Keep;
|
43 | 44 | import androidx.annotation.VisibleForTesting;
|
| 45 | +import androidx.core.content.pm.PackageInfoCompat; |
44 | 46 | import com.google.android.gms.common.util.AndroidUtilsLight;
|
45 | 47 | import com.google.android.gms.common.util.Hex;
|
46 | 48 | import com.google.firebase.remoteconfig.BuildConfig;
|
@@ -322,9 +324,10 @@ private JSONObject createFetchRequestBody(
|
322 | 324 | context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
323 | 325 | if (packageInfo != null) {
|
324 | 326 | requestBodyMap.put(APP_VERSION, packageInfo.versionName);
|
| 327 | + requestBodyMap.put(APP_BUILD, PackageInfoCompat.getLongVersionCode(packageInfo)); |
325 | 328 | }
|
326 | 329 | } catch (NameNotFoundException e) {
|
327 |
| - // Leave app version blank if package cannot be found. |
| 330 | + // Leave app version and build number blank if package cannot be found. |
328 | 331 | }
|
329 | 332 |
|
330 | 333 | requestBodyMap.put(PACKAGE_NAME, context.getPackageName());
|
|
0 commit comments