Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to iOS 3.7.1 and Android 3.5.0 #51

Merged
merged 18 commits into from
Sep 17, 2020
Merged

Update to iOS 3.7.1 and Android 3.5.0 #51

merged 18 commits into from
Sep 17, 2020

Conversation

vegaro
Copy link
Contributor

@vegaro vegaro commented Sep 10, 2020

  • Adds nonSubscriptionPurchases to RCPurchaserInfo
  • Adds attribution v2

This should be released whenever we release attribution v2

@vegaro vegaro marked this pull request as draft September 10, 2020 19:10
@@ -1,2 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.revenuecat.purchases.common" />
package="com.revenuecat.purchases.hybridcommon" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was giving issues with the common module of the Purchases sdk

@@ -23,30 +23,6 @@ import com.revenuecat.purchases.restorePurchasesWith
import org.json.JSONObject
import java.net.URL

fun addAttributionData(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"unsubscribeDetectedAtMillis" to this.unsubscribeDetectedAt?.toMillis(),
"billingIssueDetectedAt" to this.billingIssueDetectedAt?.toIso8601(),
"billingIssueDetectedAtMillis" to this.billingIssueDetectedAt?.toMillis()
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted from mappers.kt

mapOf(
"all" to this.all.asIterable().associate { it.key to it.value.map() },
"active" to this.active.asIterable().associate { it.key to it.value.map() }
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted from mappers.kt

"packageType" to packageType.name,
"product" to product.map(),
"offeringIdentifier" to offeringIdentifier
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted from mappers.kt

"managementURL" to managementURL?.toString(),
"originalPurchaseDate" to originalPurchaseDate?.toIso8601(),
"originalPurchaseDateMillis" to originalPurchaseDate?.toMillis(),
"nonSubscriptionTransactions" to nonSubscriptionTransactions.map { it.map() }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted from mappers.kt and added nonSubscriptionTransactions

@@ -71,7 +71,7 @@ private static PurchasesPeriod create(int years, int months, int days) {
* @return the parsed period, not null
* @throws RuntimeException if the text cannot be parsed to a period
*/
@Nullable static PurchasesPeriod parse(@NonNull CharSequence text) {
@Nullable public static PurchasesPeriod parse(@NonNull CharSequence text) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made public because I moved it to another package

mapOf(
"all" to this.all.asIterable().associate { it.key to it.value.map() },
"active" to this.active.asIterable().associate { it.key to it.value.map() }
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file used to be mappers.kt and extracted a lot of the mappers to their own files. I moved the SkuDetails related functions to SkuDetailsMapper.kt but Git things that I renamed the mappers.kt file.

"productId" to this.productId,
"purchaseDateMillis" to this.purchaseDate.toMillis(),
"purchaseDate" to this.purchaseDate.toIso8601()
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is new


internal fun Date.toMillis(): Double = this.time.div(1000.0)

internal fun Date.toIso8601(): String = Iso8601Utils.format(this)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were extracted from mappers.kt

}

// endregion
// region Attribution IDs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new stuff starts here

@vegaro vegaro requested a review from aboedo September 11, 2020 22:25
@vegaro vegaro marked this pull request as ready for review September 11, 2020 22:25
@@ -97,4 +96,7 @@ dependencies {
repositories {
google()
jcenter()
maven {
url "http://oss.sonatype.org/content/repositories/snapshots/"
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary until we release attribution v2

Copy link
Member

@aboedo aboedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!! heads up that you can already update PurchasesHybridCommon.podspec to include Purchases 3.6.0 and that should fix the tests on the iOS side at least

@@ -0,0 +1,18 @@
# iOS

## Point to a local Purchases project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@vegaro
Copy link
Contributor Author

vegaro commented Sep 14, 2020

Going to hold on this until attributes are released

@vegaro vegaro requested a review from aboedo September 16, 2020 23:39
@vegaro vegaro changed the title Update Update to iOS 3.7.1 and Android 3.5.0 Sep 17, 2020
@vegaro vegaro merged commit d1e3f46 into develop Sep 17, 2020
@vegaro vegaro deleted the update branch September 17, 2020 20:11
@vegaro vegaro mentioned this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants