Add the type to Product
It would be handy to have the type of the Product in the Product type. I know I could deduce it because I load them with Purchases.getProducts(ids, type: PurchaseType.subs) or Purchases.getProducts(ids, type: PurchaseType.inapp), but you could too. Having to wrap your product just to add this field is not that clean.
@rocboronat I feel your pain.
This is harder to get right than you'd expect, though, because the APIs for it aren't great.
For example, Apple's SKProduct doesn't have a field for it.
We can somewhat use the existence of a subscriptionPeriod to figure out whether a product is a subscription or not, but granularity for "is this a consumable or lifetime" wouldn't be possible with that implementation. We would also not be able to distinguish an auto-renewable from a non-auto-renewable subscription, either.
So the most we could do would be "subscription" or "nonSubscription". Or isSubscription, for that matter.
We're working on moving to using StoreKit 2 under the hood, which would allow us to provide a detailed type, with values like consumable, nonConsumable, nonRenewable, autoRenewable.
On Google's side, things are tricky too.
Google has no concept of "consumable" vs "non-consumable", rather, it's how you use it. I.e.: if you consume a product, it becomes a consumable.
So we'd again only be able to provide something like "subscription" vs "non-subscription".
I think that could still be valuable, though. I'm going to bring this up with the team.
Oh, I'm moving the conversation to your own issue, as I see you ask there for my feedback. Thank you so much for moving it, @aboedo and @beylmk 👍
Oh, I just saw the issue was on the iOS implementation, not the flutter one 😅
My opinion is there, but let's have this issue open, just not to forget it in case the iOS one moves forward.
Hello! It doesn't seem like we have quite enough information to send this to a human yet to help out. We would love if you could provide more details about your issue by following the template without modifying any of the pre-filled text. If you're looking for support, head over to our Community.
Bot, behave 😝
haha sorry about the bot!
Sounds good! We can keep this one around until the iOS changes get propagated to our flutter SDK too.
Thanks for opening @rocboronat!
iOS portion completed -- see https://github.com/RevenueCat/purchases-ios/issues/1295
We can keep this ticket open for the Flutter implementation