You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.
Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.
Bug Information
Version Number of Plugin: 1.2.5
Device Tested On: iPhone 6, iOS 11.3.1
Simulator Tested On: None
Version of VS: 15.6.7
Version of Xamarin: 4.9.0.753
Versions of other things you are using:
Steps to reproduce the Behavior
Create an Auto renewing subscription with introductory price. Only localized to english, but prices set for all available contries
Testing with a norwegian sandbox account, with english UI on the phone, not sure if this is relevant (prices show up as NOK, but all text and UI localization is in english).
Run GetProductInfoAsync with the created product id
Expected Behavior
Get a list of products
Actual Behavior
I get an ArgumentNullException, because apparently SKProduct.IntroductoryPrice.PriceLocale is null, while SKProduct.PriceLocale is not. Happens in
public static string LocalizedPrice(this SKProductDiscount product) src\Plugin.InAppBilling.iOS\InAppBillingImplementation.cs, line 548
I'm not sure if I've set something up wrong, or if this is a bug on the Xamarin or iOS side of things, but I've managed to do a workaround by changing the LocalizedPrice extension method to:
public static string LocalizedPrice(this SKProductDiscount product, NSLocale locale)
And the call on GetProductInfoAsync to:
LocalizedIntroductoryPrice = IsiOS112 ? (p.IntroductoryPrice?.LocalizedPrice(p.IntroductoryPrice?.PriceLocale ?? p.PriceLocale) ?? string.Empty) : string.Empty,
I can make a PR tomorrow is this is an acceptable fix, just wanted to check if anyone knows anything more about this issue than I can find out right now.
Code snippet
IInAppBilling billing = CrossInAppBilling.Current;
try
{
bool connected = await billing.ConnectAsync();
if (connected)
{
// Gets product id's from our server (only a single one in the test case)
List<string> productIDs = this.GetProductIDs();
// Exception happens here, when ToList triggers the Linq Select call in GetProductInfoAsync
var subscriptions = (await billing.GetProductInfoAsync(ItemType.Subscription, productIDs.ToArray())).ToList();
return subscriptions;
}
}
catch (Exception ex)
{
this.logger.LogError(ex);
}
finally
{
await billing.DisconnectAsync();
}
return null;
Screenshots
Downloaded the project and stopped where the InAppBillingProduct(s) are created
The text was updated successfully, but these errors were encountered:
Thanks, I think I prefer my solution of falling back to SKProduct.PriceLocale if the other one is null as I can't see any scenario where they wouldn't be the same anyways. Do you want me to submit a PR for it, or do you prefer the version of returning string.empty?
If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.
Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.
Bug Information
Version Number of Plugin: 1.2.5
Device Tested On: iPhone 6, iOS 11.3.1
Simulator Tested On: None
Version of VS: 15.6.7
Version of Xamarin: 4.9.0.753
Versions of other things you are using:
Steps to reproduce the Behavior
Expected Behavior
Actual Behavior
public static string LocalizedPrice(this SKProductDiscount product) src\Plugin.InAppBilling.iOS\InAppBillingImplementation.cs, line 548
I'm not sure if I've set something up wrong, or if this is a bug on the Xamarin or iOS side of things, but I've managed to do a workaround by changing the LocalizedPrice extension method to:
public static string LocalizedPrice(this SKProductDiscount product, NSLocale locale)
And the call on GetProductInfoAsync to:
LocalizedIntroductoryPrice = IsiOS112 ? (p.IntroductoryPrice?.LocalizedPrice(p.IntroductoryPrice?.PriceLocale ?? p.PriceLocale) ?? string.Empty) : string.Empty,
I can make a PR tomorrow is this is an acceptable fix, just wanted to check if anyone knows anything more about this issue than I can find out right now.
Code snippet
Screenshots
Downloaded the project and stopped where the InAppBillingProduct(s) are created
The text was updated successfully, but these errors were encountered: