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?
|
||||
boolean subscribedToLiveUpdates = false;
|
||||
List<Purchase> liveUpdatesPurchases = new ArrayList<>();
|
||||
for (InAppPurchase p : getLiveUpdates().getAllSubscriptions()) {
|
||||
Purchase purchase = getPurchase(p.getSku());
|
||||
if (purchase != null) {
|
||||
liveUpdatesPurchases.add(purchase);
|
||||
for (InAppSubscription s : getLiveUpdates().getAllSubscriptions()) {
|
||||
Purchase purchase = getPurchase(s.getSku());
|
||||
if (purchase != null || s.getState().isActive()) {
|
||||
if (purchase != null) {
|
||||
liveUpdatesPurchases.add(purchase);
|
||||
}
|
||||
if (!subscribedToLiveUpdates) {
|
||||
subscribedToLiveUpdates = true;
|
||||
}
|
||||
|
|
|
@ -697,6 +697,10 @@ public class InAppPurchases {
|
|||
public boolean isGone() {
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue