我需要哪些模型和字段来处理订阅,例如 Apple Auto Renewable 订阅?
What models and fields do I need to handle subscriptions such as Apple's Autorenewable Subscriptions?
我想建立一个自动更新的订阅服务,有一个介绍性试用期。似乎没有太多关于我需要哪些模型和字段来最好地建模(和未来证明)我的订阅的书面文档。我现在开始使用 Apple 的 App 商店,但我确实有一个网络界面,并且想在某个时候去 Play 商店。
来自这个视频:https://developer.apple.com/videos/play/wwdc2018/705/ 看来我需要的最低限度是一个 Subscription
模型,其中包含字段 userId, productId, originalTransactionId, latestExpiresDate, consumedProductDiscounts, latestReceiptData
.
我还需要什么吗?
我以后能否正确检索其他订阅信息并增加我的 table(即视频中建议的 billingRetry
宽限期信息;我的理解是通过发送保存的收据数据我可以再次获取 JSON blob 并在需要时检索其他字段)?
这是否可以扩展以与网络和 Play 商店订阅共存?
这些是我们用来处理订阅的模型。也许对你有帮助。
struct BillingTransaction : Codable {
var expires_date: String
var original_purchase_date: String
var is_in_intro_offer_period: Bool
var product_id: String
var original_transaction_id: Int
var transaction_id: Int
}
struct BillingReceipt : Codable {
var app_item_id: String
var application_version: String
var bundle_id: String
var in_app: [BillingTransaction]
}
struct BillingRenewalInfo : Codable {
var product_id: String
var auto_renew_product_id: String
var auto_renew_status: Int
var is_in_billing_retry_period: Int
var original_transaction_id: Int
}
我想建立一个自动更新的订阅服务,有一个介绍性试用期。似乎没有太多关于我需要哪些模型和字段来最好地建模(和未来证明)我的订阅的书面文档。我现在开始使用 Apple 的 App 商店,但我确实有一个网络界面,并且想在某个时候去 Play 商店。
来自这个视频:https://developer.apple.com/videos/play/wwdc2018/705/ 看来我需要的最低限度是一个 Subscription
模型,其中包含字段 userId, productId, originalTransactionId, latestExpiresDate, consumedProductDiscounts, latestReceiptData
.
我还需要什么吗?
我以后能否正确检索其他订阅信息并增加我的 table(即视频中建议的 billingRetry
宽限期信息;我的理解是通过发送保存的收据数据我可以再次获取 JSON blob 并在需要时检索其他字段)?
这是否可以扩展以与网络和 Play 商店订阅共存?
这些是我们用来处理订阅的模型。也许对你有帮助。
struct BillingTransaction : Codable {
var expires_date: String
var original_purchase_date: String
var is_in_intro_offer_period: Bool
var product_id: String
var original_transaction_id: Int
var transaction_id: Int
}
struct BillingReceipt : Codable {
var app_item_id: String
var application_version: String
var bundle_id: String
var in_app: [BillingTransaction]
}
struct BillingRenewalInfo : Codable {
var product_id: String
var auto_renew_product_id: String
var auto_renew_status: Int
var is_in_billing_retry_period: Int
var original_transaction_id: Int
}