Sync cancelling subscription with server
This commit is contained in:
parent
da82ba519e
commit
1b53652adc
2 changed files with 10 additions and 4 deletions
|
@ -557,10 +557,12 @@ public class InAppPurchaseHelper {
|
||||||
// Do we have the live updates?
|
// Do we have the live updates?
|
||||||
boolean subscribedToLiveUpdates = false;
|
boolean subscribedToLiveUpdates = false;
|
||||||
List<Purchase> liveUpdatesPurchases = new ArrayList<>();
|
List<Purchase> liveUpdatesPurchases = new ArrayList<>();
|
||||||
for (InAppPurchase p : getLiveUpdates().getAllSubscriptions()) {
|
for (InAppSubscription s : getLiveUpdates().getAllSubscriptions()) {
|
||||||
Purchase purchase = getPurchase(p.getSku());
|
Purchase purchase = getPurchase(s.getSku());
|
||||||
if (purchase != null) {
|
if (purchase != null || s.getState().isActive()) {
|
||||||
liveUpdatesPurchases.add(purchase);
|
if (purchase != null) {
|
||||||
|
liveUpdatesPurchases.add(purchase);
|
||||||
|
}
|
||||||
if (!subscribedToLiveUpdates) {
|
if (!subscribedToLiveUpdates) {
|
||||||
subscribedToLiveUpdates = true;
|
subscribedToLiveUpdates = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -697,6 +697,10 @@ public class InAppPurchases {
|
||||||
public boolean isGone() {
|
public boolean isGone() {
|
||||||
return this == ON_HOLD || this == PAUSED || this == EXPIRED;
|
return this == ON_HOLD || this == PAUSED || this == EXPIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isActive() {
|
||||||
|
return this == ACTIVE || this == CANCELLED || this == IN_GRACE_PERIOD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InAppSubscription(@NonNull String skuNoVersion, int version) {
|
InAppSubscription(@NonNull String skuNoVersion, int version) {
|
||||||
|
|
Loading…
Reference in a new issue