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
Creates two flavors for easier publication of BillingClient 3 compatible library #444
Conversation
val Purchase.firstSku: String | ||
get() = skus[0].also { | ||
if (skus.size > 0) { | ||
log(LogIntent.GOOGLE_WARNING, BillingStrings.BILLING_PURCHASE_MORE_THAN_ONE_SKU) | ||
} | ||
} | ||
|
||
val Purchase.listOfSkus: ArrayList<String> |
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.
❤️
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.
Glad you like the name because I didn't know what to name it haha. We need something different than skus
so it doesn't collide 🤷♂️
😻 this is such a cool idea |
70f8f98
to
99a7c7a
Compare
This pull request has been linked to Shortcut Story #12566: Deploy version of purchases with BillingClient 3 compatibility. |
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.
looking great so far!
common/build.gradle
Outdated
newBillingImplementation "com.android.billingclient:billing:$billingVersion" | ||
oldBillingCompileOnly "com.android.billingclient:billing:$oldBillingVersion" |
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 may just be me, but I'm somewhat allergic to new vs old naming, since it doesn't tell you much about when it was considered "new" or what being "old" means. I'd personally go with names that clearly outline billing 3 vs billing 4
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.
for some reason I thought I couldn't add numbers to the variant names but looks like we can so I will just go with billingClient3 and billingClient4
96d9012
to
17aeced
Compare
…g-flavors # Conflicts: # examples/purchase-tester-java/build.gradle
This is finally ready for review. I fixed tests and added Amazon v2 dependency, which thankfully didn't introduced any code changes. |
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.
amazing job on this one!!
@@ -0,0 +1,25 @@ | |||
package com.revenuecat.purchases.common |
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 wonder if it's be worth having the file name reflect the fact that this is billing client 4. I see that the path does say latestDependencies
, but like, when you're looking up a file by name, you might miss the path
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.
Yes, good idea. It's easier to look for the files. The thing with the path is that gradle will compile anything in main
and in latestDependencies
if the latestDependencies
flavor is selected. It will compile anything in unityIAP
and main
if the unityIAP
is selected. Pretty magical huh!
this.sku | ||
}, orderId: ${this.orderId}, purchaseToken: ${this.purchaseToken}" | ||
|
||
val Purchase.firstSku: String |
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.
❤️
type = productTypes[purchase.sku] | ||
presentedOffering = presentedOfferingsByProductIdentifier[purchase.sku] | ||
type = productTypes[purchase.firstSku] | ||
presentedOffering = presentedOfferingsByProductIdentifier[purchase.firstSku] | ||
} |
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.
👏
Quick question if you allow: What exactly would the Unity IAP have with Play Billing v4? As far as I can see, it's mostly abstracted under the hood, but I am curious what could have been broken. Thank you! |
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'm not able to run individual tests through Android Studio (right-clicking on a test and running). I think I narrowed it down to this commit. After it I get this now:
Task 'testDebugUnitTest' not found in project ':common'.
if (publishVariant == "unityIAPRelease") { | ||
project.ext.POM_ARTIFACT_ID = artifactId + "-unityiap" | ||
} | ||
println "$project.ext.POM_ARTIFACT_ID" |
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.
Did you mean to leave 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.
No lol. But I will remove it. Better late than never haha. Sorry I missed this until now
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.
@NachoSoto what build variants do you see in the Build Variants section of Android Studio? |
I filed #490. |
[sc-12566]
Unity IAP is not compatible with the BillingClient 4 yet. We point devs to use an old version of purchases-unity that has an old version of purchases-android with BillingClient 3.
This is bad because those versions are missing bugfixes, identity v3, etags, etc.
This PR adds another flavor of purchases-android that uses BillingClient 3.
Tested the deploys in #446