我正在尝试实现StoreKit2 API以实现IAP,但一直收到错误Error Domain=ASDErrorDomain Code=509 "No active account"
。
我在网上搜索过,但找不到任何关于不同ASDErrorDomain错误代码的信息。有人知道这个错误意味着什么吗?
如果你好奇,我的完整错误日志如下。
2022-05-31 02:33:35.491370-0500 (app name deleted for privacy) [Default] Error enumerating unfinished transactions for first transaction listener: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
2022-05-31 02:33:35.884686-0500 (app name deleted for privacy) [Default] [StoreKit] Failed to get products through appstored in simulator, will try using appstoreagent on host mac:
Error Domain=ASDErrorDomain Code=507 "Error decoding response" UserInfo={NSLocalizedDescription=Error decoding response, NSLocalizedFailureReason=Could not decode media products response}
2022-05-31 02:33:36.296678-0500 (app name deleted for privacy) [Default] Error enumerating monthlySubscription current transactions: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
objc[16313]: Class _PathPoint is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore (0x126673338) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TextInputUI.framework/TextInputUI (0x137570fe8). One of the two will be used. Which one is undefined.
objc[16313]: Class _PointQueue is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore (0x126673310) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TextInputUI.framework/TextInputUI (0x137571010). One of the two will be used. Which one is undefined.
2条答案
按热度按时间2wnc66cl1#
我自己在谷歌上搜索了一下,没有找到什么,但是遇到了这个链接https://developer.apple.com/forums/thread/660287,它告诉我你的设备没有连接到苹果商店,因此无法继续使用StoreKit。转到设置,点击第一部分,在那里的个人资料图片,并登录一个有效的appleid。我希望这能帮助!
uurv41yg2#
您可以在模拟器中测试IAP,而无需连接到App Store。在这种情况下,默认情况下项目没有设置为这样做。您必须在构建方案的run〉options选项卡下选择包含的StoreKit配置,以使SKDemo应用按预期运行。
通过查看这些测试StoreKit的通用说明,我找到了它。您也可以在这里找到一些有用的信息-https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode?language=objc
编辑:原来它实际上是在项目站点上的说明中(duh)-https://developer.apple.com/documentation/storekit/in-app_purchase/implementing_a_store_in_your_app_using_the_storekit_api在“配置示例代码项目”下