yeriomin / play-store-api

Google Play Store protobuf API wrapper in java
GNU General Public License v3.0
324 stars 131 forks source link

Add if app is now free? #4

Closed mostmaz closed 7 years ago

mostmaz commented 7 years ago

hi thank you for this api it is very useful can you please add a way to get if the app is now free? some apps goes from paid to free for certain period , is there a way to check if the is free now?

yeriomin commented 7 years ago

Hello. I do it like this:

    static public boolean isFree(DocV2 details) {
        if (details.getOfferCount() > 0) {
            return details.getOffer(0).getMicros() == 0;
        }
        return false;
    }
mostmaz commented 7 years ago

Can you please give me an example ?

i do like this to get app package name :

String apppackagename = app.getPackageName();

how to do the same for getting offer is free or paid like you did above?

mostmaz commented 7 years ago

Please?

mostmaz commented 7 years ago

I got it , thankyou