我一直在实施这个问题很长一段时间。我一直无法这样做。 我已完成所有先决条件,在沙盒中设置测试用户,在itunesconnect上设置IAP产品等。在设备上,我从设置中退出应用程序商店。
我已更新到最新的GDX和GDXPay版本,
gdxVersion = '1.9.1'
roboVMVersion = '1.12.0'
gdxpayVersion = '0.9.2'
但是,在调用installIAP()
时应用程序崩溃而没有给我提示符号。但是,在应用程序崩溃后会出现登录提示。
IOSLauncher[3511:1011291] [info] IAP: IAP: gdx-pay successfully instantiated. [GdxPay/AppleIOS] Installing purchase observer...
[GdxPay/AppleIOS] Requesting products...
IOSLauncher[3511:1011291] [debug] IOSApplication: resumed
[GdxPay/AppleIOS] Products successfully received!
[GdxPay/AppleIOS] Purchase observer successfully installed!
[GdxPay/AppleIOS] There are 0 unfinished transactions. Try to finish...
WARN: Failed to call getClassDomain() for the NSError subclass org.robovm.apple.foundation.NSCocoaError
WARN: Failed to call getClassDomain() for the NSError subclass org.robovm.apple.storekit.SKError
[GdxPay/AppleIOS] Transaction failed: Error Domain=SSServerErrorDomain Code=0 "You are not authorized to make purchases of this InApp in Sandbox at this time." UserInfo={NSLocalizedDescription=You are not authorized to make purchases of this InApp in Sandbox at this time.}
com.badlogic.gdx.utils.GdxRuntimeException: java.lang.RuntimeException: Transaction failed: Error Domain=SSServerErrorDomain Code=0 "You are not authorized to make purchases of this InApp in Sandbox at this time." UserInfo={NSLocalizedDescription=You are not authorized to make purchases of this InApp in Sandbox at this time.} at com.vxxxxxxs.pxxxxxxxg.app.PxxxxLxxxg$1.handlePurchaseError(PxxxxxLxxxxg.java:70) at com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple$AppleTransactionObserver.updatedTransactions(PurchaseManageriOSApple.java:392) at com.badlogic.gdx.pay.ios.apple.PurchaseManageriOSApple$AppleTransactionObserver.$cb$paymentQueue$updatedTransactions$(PurchaseManageriOSApple.java) at org.robovm.apple.uikit.UIApplication.main(Native Method) at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:395) at com.vxxxxxs.pxxxxxxxxg.app.IOSLauncher.main(IOSLauncher.java:42)
Caused by: java.lang.RuntimeException: Transaction failed: Error Domain=SSServerErrorDomain Code=0 "You are not authorized to make purchases of this InApp in Sandbox at this time." UserInfo={NSLocalizedDescription=You are not authorized to make purchases of this InApp in Sandbox at this time.} ... 5 more