问题:

 

 

解决:

  1. xcode target 属性启用 In-app purchase
  2. 在itunesConnect 后台app 功能下添加 内购产品,记住填写的商品id; 添加测试用户(可选)
  3. 在代码中使用 商品id获取SKProduct

     
  4. 获取到SKProduct 后 会回调

     
  5. 购买有结果后会回调

     
  6. 退出iphone 上app store 的登录账号,进入app 购买流程,输入账号时使用步骤2中添加的测试账号测试购买(切换成正式账号就能把测试账号踢掉)
  7. 必须有恢复购买功能,恢复购买时需要调用

     

 

 

参考:

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/ShowUI.html#//apple_ref/doc/uid/TP40008267-CH3-SW6

https://developer.apple.com/library/content/technotes/tn2259/_index.html#//apple_ref/doc/uid/DTS40009578

发表评论

电子邮件地址不会被公开。