上面的官网链接有提到第一次创建的IAP项目需要随APP版本提交审核,以是代码查询productid的时候会报错说找不到,但是GPT说只要状态是Ready for submit就可以测试,以是在这里堵了不少时间。
大家可以设置Storekit到Xcode测试,如下:‘File from Template’,在创建这个文件之前最好现在Apple Connect创建好IAP项目,创建文件的时候就可以直接导进来了。
创建之后在Schema里面选中这个storekit然后就可以测试了。
注:
1. 如果遇到Flutter run unable to attach to process on iOS 17, "Not allowed to attach to process,可以参考:https://github.com/flutter/flutter/issues/142502
2. 如果遇到0xe8008001 (An unknown error has occurred.) Verify that the Developer App certificate for your account is trusted on your device. Open Settings on the device and navigate to General -> VPN & Device Management, then select your Developer App certificate to trust it.可以参考:Unable to install “myapp” | Apple Developer Forums
简朴来说就是因为一些设置没生效,删掉重装。
3. 如果遇到Xcode: Could not attach to pid,可以参考:Xcode: Could not attach to pid | Apple Developer Forums
简朴来说就是更新Schema的设置,把Debug excitable去掉,记得Build Configuration选Release。
4. 如果遇到Getting Logging Error: Failed to initialize logging system. when running app,可以参考:Getting Logging Error: Failed to i… | Apple Developer Forums