Closed lozan closed 7 years ago
That method is not available on iOS 9, so you can't use it.
Right, but it's in gdx-pay. Or you mean I can't use PurchaseSystem.getInformation() ? Isn't there a way to get info about a product on iOS 9 through gdx-pay?
I don't use the library, but if thats the case then it should be declared not compatible with < iOS 10, or it should not use that API internally.
The iosmoe implementation is based on the robovm implementation. org.robovm.apple.foundation.NSLocale#getCurrencySymbol
implementation:
public String getCurrencySymbol() {
if (Foundation.getMajorSystemVersion() >= 10) {
return getCurrencySymbol0();
} else {
NSString val = (NSString)getComponent(NSLocaleComponent.CurrencySymbol);
return val.toString();
}
}
So on Robovm this doesn't crash, only on MOE.
We should probably use apple.foundation.NSLocale#objectForKey. with key "CurrencyCode".
Robovm has listed the keys in org.robovm.apple.foundation.NSLocaleComponent
. Has MOE something similar @liliomk?
There's something in: https://github.com/multi-os-engine/moe-core/blob/master/moe.apple/moe.platform.ios/src/main/java/apple/foundation/NSLocale.java public native String currencyCode();
I'm not sure if that's what's needed here though
I have fixed that particular call and published a SNAPSHOT to https://oss.sonatype.org/content/repositories/snapshots/
Can you give it a try in iOS 9?
Works only with Xcode 8 (moe doesn't support Xcode 9 yet, that's why I cannot test this anymore)
It works. Awesome! I tested this on the following iOS versions, and it's all good:
9.3.4 (iPhone) 9.3.5 (iPad) 10.3.3 (iPhone) 11.0 (iPad)
Thanks for testing! Released 0.11.2 which has this fix.
Calling PurchaseSystem.getInformation(String identifier) crashes the app on iOS 9. It works on iOS 10 and 11.
The issue seems to be in "gdx-pay-iosmoe-apple/src/main/java/com/badlogic/gdx/pay/ios/apple/PurchaseManageriOSApple.java" in the function "public Information getInformation(String identifier)".
Based on the exception, I assume the call that makes it crash is the following: p.priceLocale().currencyCode()
Here's the exception: