简体   繁体   English

Apple In App Purchase-如何从App Store获取产品的订阅期?

[英]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和持续时间。 具有productIds的PList

And with durations: 以及持续时间: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在应用内购买 - 订阅 - 不基于Apple Id - In app purchase - Subscription - not based on Apple Id 如何在 iOS 的应用内购买中获得活动产品的取消订阅? - How to get active product's cancel subscription in In-App Purchase in iOS? 从Google Play商店和Apple App Store获取购买日期 - Get purchase date from Google Play Store and Apple App Store 苹果应用程序内购买和苹果“商店信用” - Apple In App Purchase & Apple “Store Credit” 应用购买订阅验证中的应用商店失败 - App store in app purchase subscription validation fail 如何在Apple Connect中获取ProductID?(在应用内购买) - How can fetch ProductIDs in Apple Connect?(In App Purchase) Apple 订阅或应用内购买在商店版本中不起作用 - 应用内产品详细信息未显示或获取 - Apple subscription or in-app purchase not working in store version - inApp-products details not displaying or getting 如何在同一订阅组中使用 Apple In-App Purchase 对订阅计划进行排名? - How to rank subscription plans using Apple In-App Purchase in same subscription group? 处理应用购买-从我自己的服务器中获取产品标识符 - Handling in app purchase - fetch product identifiers from my own server 在Apple Watch应用上实现应用内购买自动续订订阅? - Implementing an in-app purchase auto renewing subscription on an Apple Watch app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM