简体   繁体   English

iOS-我可以自定义Apple托管的应用内购买内容吗?

[英]iOS - Can I customise in-app purchase content hosted with Apple?

I'm planning to host my in-app purchase content with Apple. 我正计划与Apple托管我的应用内购买内容。 The thing is I want it to be customisable. 问题是我希望它是可定制的。

For example. 例如。 I have 100 images in my in-app package, the user will be able to choose any 50 images and purchase it for $0.99. 我的应用内包装中有100张图片,用户可以选择任意50张图片,并以0.99美元的价格购买。

Is this possible? 这可能吗? How can I accomplish this? 我该怎么做?

I guess I can just download all 100 images and display 50 for the user but thats not a very good method as it will take up memory space. 我想我可以下载所有100张图像并为用户显示50张图像,但这并不是一个很好的方法,因为它会占用内存空间。 And I don't know if Apple will allow this. 而且我不知道苹果是否会允许这样做。

Thanks in advance. 提前致谢。

One alternative is to download all the 100 images and show 50 to the user - like you described. 一种选择是下载所有100张图像,并向用户显示50张图像-如您所述。 But this is not optimal. 但这不是最佳的。 The other alternative is to setup an IAP for purchasing 50 images. 另一种选择是设置一个用于购买50张图像的IAP。 If the user decides to buy just 50 images instead of all 100, you use this IAP's product id and make a purchase. 如果用户决定只购买50张图像而不是全部100张图像,则使用此IAP的产品ID并进行购买。 What images are downloaded would probably be best handled by your app in communication with a custom server component. 您下载的图像最好由您的应用与自定义服务器组件进行通信来处理。 That is the only way you can achieve this with the current iOS IAP structure. 这是使用当前iOS IAP结构实现此目标的唯一方法。

first, since you want Apple to host your content, then you only option is pack 100 images into your $0.99 package, then after the package downloaded by user, it just depends on yourself to give the user access, of course half the images got wasted, or you may just price the whole package for the price of $1.99, that's 100 images! 首先,由于您希望Apple托管您的内容,因此,您唯一的选择是将100张图像打包到您的$ 0.99软件包中,然后在用户下载该软件包后,这取决于您自己来授予用户访问权限,当然,浪费了一半图像,或者您可以仅以1.99美元的价格为整套产品定价,即100张图片! :-) :-)

When you setup a IAP you must provide the restore capability too. 设置IAP时,还必须提供还原功能。 So now imagine you find a way to let the user to buy 50 images and pick any 50 images from the set of 100; 因此,现在想象一下,您找到了一种方法,让用户购买50张图像,并从100张图像中挑选出50张。 then imagine the user will delete the app from the device and re-install it: using "purchase restore" you will be able to identify the app as eligible to download some 50 images but you will not be able to identify which 50 images need to be picked exactly from the whole set of 100. So what are you trying to achieve is not possible with current IAP structure. 然后想象用户将从设备中删除该应用并重新安装该应用:使用“购买还原”,您将能够确定该应用符合下载约50张图片的资格,但您将无法确定需要下载50张图片完全是从100个集合中挑选出来的。因此,使用当前的IAP结构,您要实现的目标是不可能的。

Instead you can do this using a different approach: you ask the user to register herself (eg using email address and password), then you provide with IAP a 1.99$ consumable that, when purchased, allows the user to select 50 images from the pool of 100. The set of the images + the email/password credentials will be associated and saved on a database and the user will then be able to restore in the future the images using the same email address but she will not be able to download new images until she buys a new consumable. 相反,您可以使用另一种方法来执行此操作:您要求用户进行注册(例如,使用电子邮件地址和密码),然后向IAP提供1.99美元的消耗品,该消耗品在购买时允许用户从存储池中选择50张图像(共100张)。图片集+电子邮件/密码凭据将被关联并保存在数据库中,然后用户将来可以使用相同的电子邮件地址还原图片,但她将无法下载新图片直到她购买新的耗材。 Restoring will be guaranteed on every device until the correct credentials are provided; 在提供正确的凭据之前,将确保在每台设备上进行还原。 you can limit this possibility to a maximum number of devices (eg 4) to avoid any abuse. 您可以将这种可能性限制为最多设备数量(例如4个),以避免任何滥用。 Of course this approach require a server setup from your side to keep track of emails, purchases and IDs of downloaded pictures; 当然,这种方法要求您从服务器端进行设置,以跟踪电子邮件,购买的图片以及所下载图片的ID。 you cannot rely on Apple IAP mechanism and hosting only. 您不能仅依靠Apple IAP机制和托管。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM