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

PurchaseManager does not support consumables and subscriptions at the same time. #237

Open
xfwang515 opened this issue Dec 25, 2020 · 3 comments

Comments

@xfwang515
Copy link

List offers = new ArrayList<>();
offers.add(new Offer().setType(OfferType.CONSUMABLE).setIdentifier(BuyCoinType.coins1.produceId));
offers.add(new Offer().setType(OfferType.CONSUMABLE).setIdentifier(BuyCoinType.coins2.produceId));
offers.add(new Offer().setType(OfferType.CONSUMABLE).setIdentifier(BuyCoinType.coins3.produceId));

offers.add(new Offer().setType(OfferType.SUBSCRIPTION).setIdentifier(BuyCoinType.weekly.produceId));
offers.add(new Offer().setType(OfferType.SUBSCRIPTION).setIdentifier(BuyCoinType.monthly.produceId));
offers.add(new Offer().setType(OfferType.SUBSCRIPTION).setIdentifier(BuyCoinType.yearly.produceId));

//
throw new IllegalStateException("Cannot support OfferType Subscription and other types in the same app");

What should I do if there are both "consumables" and "subscriptions" in the game?

@MrStahlfelge
Copy link
Member

Either use two purchase managers, or for the repo, enhance the framework and open a PR contributing your changes.

@Trurl101
Copy link

Trurl101 commented Aug 11, 2021

Its relatively easy to use two Purchase managers. I tried it with one of my apps last year and it works fine (and people on mobile seems to like subscriptions).

Anyway I think it should be reflected in the readme and wiki that you can not have both pay models with one Purchase Manager because here the readme suggest the opposite:

PurchaseManagerConfig pmc = new PurchaseManagerConfig();
pmc.addOffer(new Offer().setType(OfferType.ENTITLEMENT).setIdentifier(YOUR_ITEM_SKU));
pmc.addOffer(new Offer().setType(OfferType.CONSUMABLE).setIdentifier(YOUR_ITEM_SKU));
pmc.addOffer(new Offer().setType(OfferType.SUBSCRIPTION).setIdentifier(YOUR_ITEM_SKU));
// some payment services might need special parameters, see documentation
pmc.addStoreParam(storename, param)

@MrStahlfelge
Copy link
Member

If you have a good suggestion what to add where to the wiki, I'll be happy to add it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants