StoreKit returns 如果用户在进入隧道之前付款
What StoreKit returns if user pays right before going into a tunnel
Apple doc 表示如下:
For example, if a user buys something in your app right before going into a tunnel, your app may not be able to deliver the purchased content if there is no network connection. The next time your app launches, StoreKit calls your transaction queue observer again and your app should handle the transaction and deliver the purchased content.
我想知道当StoreKit无法在隧道中完成购买时,应用程序是否通过paymentQueue(_:updatedTransactions:)
收到任何东西?
我的第一个想法是 StoreKit 可能 return SKPaymentTransactionState.failed
与网络连接有关 error domain or code。但如果是这样,应用程序将调用 finishTransaction(_:)
以删除支付队列中的交易。因此,上述文档最后一句中描述的内容 永远不会 发生。
那么,这是否意味着在上述情况下,StoreKit 没有 return 任何东西,而且应用程序似乎挂在用户身上?用户是否必须终止应用程序才能继续?或者购买视图(由 StoreKit 呈现)不会阻止应用程序的 UI,因此用户可以关闭购买视图并继续使用该应用程序(我想该应用程序未实现 activity 指示器查看以阻止 UI)?
感谢您的帮助。
苹果文档中描述的情况是苹果这边购买已经完成,但是你的应用无法传送内容。
例如,用户可能租借了电影。需要在您的服务器上记录对此租赁的访问。
如果他们在 Apple returns 进入 .purchased
状态后进入隧道,但在您从服务器确认购买已被记录之前,您不会调用 completeTransaction
因为在您的服务器上记录购买之前,交易尚未完成。您可能会遇到网络错误或与您的服务器通信超时。
待处理的交易将保留在队列中,供您的应用稍后重试。
Apple doc 表示如下:
For example, if a user buys something in your app right before going into a tunnel, your app may not be able to deliver the purchased content if there is no network connection. The next time your app launches, StoreKit calls your transaction queue observer again and your app should handle the transaction and deliver the purchased content.
我想知道当StoreKit无法在隧道中完成购买时,应用程序是否通过paymentQueue(_:updatedTransactions:)
收到任何东西?
我的第一个想法是 StoreKit 可能 return SKPaymentTransactionState.failed
与网络连接有关 error domain or code。但如果是这样,应用程序将调用 finishTransaction(_:)
以删除支付队列中的交易。因此,上述文档最后一句中描述的内容 永远不会 发生。
那么,这是否意味着在上述情况下,StoreKit 没有 return 任何东西,而且应用程序似乎挂在用户身上?用户是否必须终止应用程序才能继续?或者购买视图(由 StoreKit 呈现)不会阻止应用程序的 UI,因此用户可以关闭购买视图并继续使用该应用程序(我想该应用程序未实现 activity 指示器查看以阻止 UI)?
感谢您的帮助。
苹果文档中描述的情况是苹果这边购买已经完成,但是你的应用无法传送内容。
例如,用户可能租借了电影。需要在您的服务器上记录对此租赁的访问。
如果他们在 Apple returns 进入 .purchased
状态后进入隧道,但在您从服务器确认购买已被记录之前,您不会调用 completeTransaction
因为在您的服务器上记录购买之前,交易尚未完成。您可能会遇到网络错误或与您的服务器通信超时。
待处理的交易将保留在队列中,供您的应用稍后重试。