jamesmontemagno / InAppBillingPlugin

Cross-platform In App Billing Plugin for .NET
MIT License
651 stars 152 forks source link

GetProductInfoAsync throws exceptions if the In-App-Product does not exists in the apple backend and results nothing anymore #535

Closed Sebastian1989101 closed 1 year ago

Sebastian1989101 commented 1 year ago

Title says it all.

jamesmontemagno commented 1 year ago

That checks out, I give it all the Ids and then i request it and if it has invalid items it throws: https://github.com/jamesmontemagno/InAppBillingPlugin/blob/master/src/Plugin.InAppBilling/InAppBilling.apple.cs#L639

jamesmontemagno commented 1 year ago

A feature request would be to change the API to return valid and invalid items back. Or I could just ignore them?

Sebastian1989101 commented 1 year ago

A feature request would be to change the API to return valid and invalid items back. Or I could just ignore them?

The issue is, if we remove IAP's after the app releases from AppStoreConnect, the app won't work anymore because those products are missing. Before one of the latest updates of this plugin, we just get the existing products back instead. So not sure what the proper way is, but just getting a NRE for everything is one products is missing or was removed is a worse case I guess.

jamesmontemagno commented 1 year ago

Gotcha... hmmm, on Android it would most likely return a Result of ItemUnavailable in which would throw an exception.

This was added 2 years ago: https://github.com/jamesmontemagno/InAppBillingPlugin/commit/adfe7f4e13cfd75f0ece9691e5859ab90e473b63

I will add in a way to filter it out and also return the product list in the exception that isn't valid so you could try first.