-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added onInventoryQueryFinished BillingService callback #33
base: master
Are you sure you want to change the base?
Conversation
} | ||
} | ||
} | ||
|
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.
Can we change this part to match previous style?
fun queryInventoryFinished() {
findUiHandler().post {
for (billingServiceListener in purchaseServiceListeners) {
billingServiceListener.onInventoryQueryFinished()
}
for (billingServiceListener in subscriptionServiceListeners) {
billingServiceListener.onInventoryQueryFinished()
}
}
}
/** | ||
* Callback will be triggered upon the inventory query is done | ||
*/ | ||
void onInventoryQueryFinished(); |
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 is a thought that this method is very specific to the app needs and will be used only in some rare cases.
Do we need to force all IAP lib users to integrate this new method on their projects? Can we do it optional?
As the solution we can migrate listeners from Java to Koltin and make 'onInventoryQueryFinished' to be with default implementation. Something like this
/**
* Callback will be triggered upon the inventory query is done
*/
fun onInventoryQueryFinished(){}
This will allow the developer to override this method only when he really needs it. Otherwise, the compiler will skip it.
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.
Hey guys, it's up to you wether you want to change code style, and make it optional or not, but let me explain my use case and why I think this is not a very specific use case, this is only not your use case:
For example I need it for a purchase that can make a free app version become a pro version.
Many things in the app depend on this (wether it is free or pro) so the purchase check needs to be done on application startup, and this check must be sure that the purchase has been properly queried (otherwise there is a chance the app could start with free flag while it should be pro).
Do you see more how such a callback can be used ?
Cheers !
@sloosh How's it going with the new Google Billing library support that this PR adds? Have you shipped it yet? Ditto the Amazon Appstore SDK? Thanks so much for taking the time to do this. I haven't updated my Android apps in a while, but I need to soon, and I see this is compulsory in a few days … |
@mikemee I got troubles to make it compile properly with jitpack, but this is now fixed and you can use it from my repository like this (depends on your flavors name): googleImplementation "com.github.sloosh:android-in-app-payments:3.0.4:google" This should work with Google Play billing 5 and Amazon Appstore SDK 3. |
should be fixed with gradle 7.4.0 beta version !
@mikemee new update, please use 3.0.6 instead: I had to use gradle beta version to really fix it and make it finally work fine with jitpack. |
Here are my changes about #32
That seems really necessary to me ! So now I can be sure when a product is owned or NOT.