-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
@@ -1,2 +1,2 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
package="com.revenuecat.purchases.common" /> | |||
package="com.revenuecat.purchases.hybridcommon" /> |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted all these functions to https://github.com/RevenueCat/purchases-hybrid-common/pull/51/files#diff-714925bb39d7d0a439e0cb95f477c5db
"unsubscribeDetectedAtMillis" to this.unsubscribeDetectedAt?.toMillis(), | ||
"billingIssueDetectedAt" to this.billingIssueDetectedAt?.toIso8601(), | ||
"billingIssueDetectedAtMillis" to this.billingIssueDetectedAt?.toMillis() | ||
) |
There was a problem hiding this comment.
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() } | ||
) |
There was a problem hiding this comment.
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 | ||
) |
There was a problem hiding this comment.
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() } |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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() } | ||
) |
There was a problem hiding this comment.
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() | ||
) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
android/build.gradle
Outdated
@@ -97,4 +96,7 @@ dependencies { | |||
repositories { | |||
google() | |||
jcenter() | |||
maven { | |||
url "http://oss.sonatype.org/content/repositories/snapshots/" | |||
} |
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
Going to hold on this until attributes are released |
nonSubscriptionPurchases
toRCPurchaserInfo
This should be released whenever we release attribution v2