diff --git a/app/src/amazon/java/org/tasks/billing/BillingClientImpl.java b/app/src/amazon/java/org/tasks/billing/BillingClientImpl.java index fe0021ce0..d34b9c0c3 100644 --- a/app/src/amazon/java/org/tasks/billing/BillingClientImpl.java +++ b/app/src/amazon/java/org/tasks/billing/BillingClientImpl.java @@ -7,6 +7,7 @@ import static com.google.common.collect.Sets.newHashSet; import android.app.Activity; import android.content.Context; +import androidx.annotation.Nullable; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.Observer; @@ -59,10 +60,16 @@ public class BillingClientImpl implements BillingClient, PurchasingListener { } @Override - public void initiatePurchaseFlow(Activity activity, String sku, String skuType) { + public void initiatePurchaseFlow( + Activity activity, String sku, String skuType, @Nullable String oldSku) { PurchasingService.purchase(sku); } + @Override + public void addPurchaseCallback(OnPurchasesUpdated onPurchasesUpdated) { + + } + @Override public int getErrorMessage() { return 0; diff --git a/app/src/amazon/java/org/tasks/billing/Purchase.java b/app/src/amazon/java/org/tasks/billing/Purchase.java index 68532d83e..5131f4e73 100644 --- a/app/src/amazon/java/org/tasks/billing/Purchase.java +++ b/app/src/amazon/java/org/tasks/billing/Purchase.java @@ -27,4 +27,20 @@ public class Purchase { public String toString() { return "Purchase{" + "receipt=" + receipt + '}'; } + + public boolean isCanceled() { + return false; + } + + public int getSubscriptionPrice() { + return 0; + } + + public boolean isMonthly() { + return false; + } + + public boolean isProSubscription() { + return true; + } } diff --git a/app/src/generic/java/org/tasks/billing/BillingClientImpl.java b/app/src/generic/java/org/tasks/billing/BillingClientImpl.java index 2969dc8f8..29f5a4fc5 100644 --- a/app/src/generic/java/org/tasks/billing/BillingClientImpl.java +++ b/app/src/generic/java/org/tasks/billing/BillingClientImpl.java @@ -2,6 +2,7 @@ package org.tasks.billing; import android.app.Activity; import android.content.Context; +import androidx.annotation.Nullable; import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.Observer; import java.util.List; @@ -21,7 +22,13 @@ public class BillingClientImpl implements BillingClient { } @Override - public void initiatePurchaseFlow(Activity activity, String sku, String skuType) {} + public void initiatePurchaseFlow( + Activity activity, String sku, String skuType, @Nullable String oldSku) {} + + @Override + public void addPurchaseCallback(OnPurchasesUpdated onPurchasesUpdated) { + + } @Override public void querySkuDetails() {} diff --git a/app/src/generic/java/org/tasks/billing/Purchase.java b/app/src/generic/java/org/tasks/billing/Purchase.java index 253a83c24..0a0bcb15a 100644 --- a/app/src/generic/java/org/tasks/billing/Purchase.java +++ b/app/src/generic/java/org/tasks/billing/Purchase.java @@ -11,4 +11,20 @@ public class Purchase { public String toJson() { return null; } + + public boolean isCanceled() { + return false; + } + + public int getSubscriptionPrice() { + return 0; + } + + public boolean isMonthly() { + return false; + } + + public boolean isProSubscription() { + return false; + } } diff --git a/app/src/generic/res/values/keys.xml b/app/src/generic/res/values/keys.xml index cba38186f..de721def8 100644 --- a/app/src/generic/res/values/keys.xml +++ b/app/src/generic/res/values/keys.xml @@ -4,6 +4,6 @@ https://f-droid.org/en/packages/org.tasks/ purchases_fdroid - + %s support@tasks.org \ No newline at end of file diff --git a/app/src/googleplay/res/values/keys.xml b/app/src/googleplay/res/values/keys.xml index d4677e815..a1b4aebbb 100644 --- a/app/src/googleplay/res/values/keys.xml +++ b/app/src/googleplay/res/values/keys.xml @@ -5,6 +5,5 @@ market://details?id=org.tasks purchases https://play.google.com/store/account/subscriptions?sku=%s&package=org.tasks - https://tasks.org/subscribe play-support@tasks.org \ No newline at end of file diff --git a/app/src/main/java/org/tasks/billing/NameYourPriceDialog.java b/app/src/main/java/org/tasks/billing/NameYourPriceDialog.java index 7764cd3a3..d58c38134 100644 --- a/app/src/main/java/org/tasks/billing/NameYourPriceDialog.java +++ b/app/src/main/java/org/tasks/billing/NameYourPriceDialog.java @@ -20,7 +20,6 @@ import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; -import com.android.billingclient.api.BillingClient.SkuType; import com.google.android.material.button.MaterialButton; import com.google.android.material.button.MaterialButtonToggleGroup; import com.google.common.collect.ContiguousSet; @@ -137,12 +136,12 @@ public class NameYourPriceDialog extends InjectingDialogFragment implements OnPu protected void subscribe() { if (currentSubscriptionSelected() && currentSubscription.isCanceled()) { billingClient.initiatePurchaseFlow( - (Activity) context, currentSubscription.getSku(), SkuType.SUBS, null); + (Activity) context, currentSubscription.getSku(), SkuDetails.TYPE_SUBS, null); } else { billingClient.initiatePurchaseFlow( (Activity) context, String.format("%s_%02d", isMonthly() ? "monthly" : "annual", adapter.getSelected()), - SkuType.SUBS, + SkuDetails.TYPE_SUBS, currentSubscription == null ? null : currentSubscription.getSku()); } billingClient.addPurchaseCallback(this); diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index 20aa7052f..d239ff54e 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -313,4 +313,5 @@ google_tasks_position_hack Custom order synchronization fix Always perform a full synchronization to workaround https://issuetracker.google.com/issues/132432317. This setting will disable itself after seven days. + https://tasks.org/subscribe