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

Added onInventoryQueryFinished BillingService callback #33

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

sloosh
Copy link

@sloosh sloosh commented Oct 22, 2020

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.

@sloosh sloosh marked this pull request as ready for review October 22, 2020 14:19
}
}
}

Copy link
Collaborator

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();
Copy link
Collaborator

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.

Copy link
Author

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 !

@mikemee
Copy link
Collaborator

mikemee commented Oct 29, 2022

@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 …

@sloosh
Copy link
Author

sloosh commented Oct 29, 2022

@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"
amazonImplementation "com.github.sloosh:android-in-app-payments:3.0.4:amazon"

This should work with Google Play billing 5 and Amazon Appstore SDK 3.
But you should test it yourself with you own use cases to be sure ;)

@sloosh
Copy link
Author

sloosh commented Nov 2, 2022

@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 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.
you can get it like this:
googleImplementation "com.github.sloosh:android-in-app-payments:3.0.6:googleRelease@aar"
amazonImplementation "com.github.sloosh:android-in-app-payments:3.0.6:amazonRelease@aar"

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.

3 participants