diff --git a/CHANGELOG.md b/CHANGELOG.md index 320074720a..99339ca882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [18.0.0] + +### Added +- Add support for in-app purchase auto-logging for Google Play Billing Libraries 5 through 7 + ## [17.0.2] ### Added diff --git a/facebook-core/src/main/java/com/facebook/FacebookSdkVersion.kt b/facebook-core/src/main/java/com/facebook/FacebookSdkVersion.kt index 4898afa081..da2bcf9d08 100644 --- a/facebook-core/src/main/java/com/facebook/FacebookSdkVersion.kt +++ b/facebook-core/src/main/java/com/facebook/FacebookSdkVersion.kt @@ -9,5 +9,5 @@ package com.facebook internal object FacebookSdkVersion { - const val BUILD = "17.0.2" + const val BUILD = "18.0.0" } diff --git a/facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseLoggerManager.kt b/facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseLoggerManager.kt index 622f83e2cc..12fb7bc15c 100644 --- a/facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseLoggerManager.kt +++ b/facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseLoggerManager.kt @@ -28,8 +28,8 @@ import kotlin.math.min @AutoHandleExceptions @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) object InAppPurchaseLoggerManager { - // October 31, 2024 07:00:00 GMT - private const val APPROXIMATE_IAP_ENHANCEMENT_RELEASE_TIME = 1730358000000L + // January 10, 2025 05:00:00 PM GMT + private const val APPROXIMATE_IAP_ENHANCEMENT_RELEASE_TIME = 1736528400000L private const val MILLISECONDS_IN_SECONDS = 1000.0 private const val PURCHASE_TIME = "purchaseTime" private const val IAP_SKU_CACHE_GPBLV1 = "com.facebook.internal.SKU_DETAILS" diff --git a/facebook-core/src/test/kotlin/com/facebook/appevents/iap/InAppPurchaseLoggerManagerTest.kt b/facebook-core/src/test/kotlin/com/facebook/appevents/iap/InAppPurchaseLoggerManagerTest.kt index 4433342034..d6a9bd3a56 100644 --- a/facebook-core/src/test/kotlin/com/facebook/appevents/iap/InAppPurchaseLoggerManagerTest.kt +++ b/facebook-core/src/test/kotlin/com/facebook/appevents/iap/InAppPurchaseLoggerManagerTest.kt @@ -130,9 +130,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000L) + .isEqualTo(1736528400000L) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000L) + .isEqualTo(1736528400000L) } @@ -143,7 +143,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { val mockPurchaseDetailsMap: MutableMap = mutableMapOf() val purchaseDetailJson1 = JSONObject( - "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1730358000001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" + "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1736528400001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" ) mockPurchaseDetailsMap["espresso"] = purchaseDetailJson1 @@ -164,9 +164,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isNotEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000001) + .isEqualTo(1736528400001) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -176,7 +176,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { val mockPurchaseDetailsMap: MutableMap = mutableMapOf() val purchaseDetailJson1 = JSONObject( - "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1730358000001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" + "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1736528400001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" ) mockPurchaseDetailsMap["espresso"] = purchaseDetailJson1 @@ -197,9 +197,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isNotEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000001) + .isEqualTo(1736528400001) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -224,9 +224,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -254,7 +254,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) .isEqualTo(1630000000000000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -287,9 +287,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -300,7 +300,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { val mockPurchaseDetailsMap: MutableMap = mutableMapOf() val purchaseDetailJson1 = JSONObject( - "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1730358000001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" + "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1736528400001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" ) mockPurchaseDetailsMap["espresso"] = purchaseDetailJson1 @@ -320,9 +320,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isNotEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000001) + .isEqualTo(1736528400001) } @Test @@ -333,7 +333,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { val mockPurchaseDetailsMap: MutableMap = mutableMapOf() val purchaseDetailJson1 = JSONObject( - "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1730358000001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" + "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1736528400001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" ) mockPurchaseDetailsMap["espresso"] = purchaseDetailJson1 @@ -399,7 +399,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { val mockPurchaseDetailsMap: MutableMap = mutableMapOf() val purchaseDetailJson1 = JSONObject( - "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1730358000001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" + "{\"productId\":\"espresso\",\"purchaseToken\":\"token123\",\"purchaseTime\":1736528400001,\"developerPayload\":null,\"packageName\":\"sample.packagename\"}" ) mockPurchaseDetailsMap["espresso"] = purchaseDetailJson1 @@ -419,9 +419,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isNotEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000001) + .isEqualTo(1736528400001) } @@ -447,9 +447,9 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(cachedMap).isEmpty() Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) } @Test @@ -477,7 +477,7 @@ class InAppPurchaseLoggerManagerTest : FacebookPowerMockTestCase() { Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_SUBSCRIPTION_KEY]) .isEqualTo(1620000000000001) Assertions.assertThat(mockNewCachedMap[TIME_OF_LAST_LOGGED_PURCHASE_KEY]) - .isEqualTo(1730358000000) + .isEqualTo(1736528400000) }