[英]Apple In App Purchase - How to fetch a product's subscription duration from the app store?
Can anyone tell me how to get an IAP subscription length? 谁能告诉我如何获得IAP订阅时间?
I have an app. 我有一个应用。 I have defined a Auto Renewing Subscription product and I have defined 3 different subscription lengths for this product - 1 month, 6 months and 12 months.
我已经定义了自动续订订阅产品,并且为该产品定义了3种不同的订阅时长-1个月,6个月和12个月。
I am able to poll the app store and fetch the IAP product information for my 3 subscriptions. 我能够查询应用商店并获取3个订阅的IAP产品信息。
However - I can not fetch the subscription length. 但是-我无法获取订阅长度。
Of course I know that product id #1 is 1 month. 我当然知道产品ID#1是1个月。 But I can not get this length from Apple which means I'll have to hard code the duration into the app.
但是我无法从Apple获得此长度,这意味着我必须将持续时间硬编码到应用程序中。
Surely there is a way to get a localised string that details the subscription length? 当然有办法获取详细说明订阅长度的本地化字符串吗?
I think you will need to store the durations in your app. 我认为您需要将持续时间存储在您的应用中。 Since you should already have a plist with your productIDs or at least an own server that stores the valid productIds you can also make a plist in your app bundle that stores the productIDs as well as the durations.
由于您应该已经具有一个带有productID的plist,或者至少拥有一个用于存储有效productId的服务器,因此您也可以在应用程序包中创建一个plist,用于存储productID和持续时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.