在App Purchase中:动态添加非消耗品 [英] In App Purchase: dynamically add non consumable items

查看:157
本文介绍了在App Purchase中:动态添加非消耗品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款应用程序,用户可以在其中购买数字地图,图表等。我想将它们包含在应用内购买中。事情是,我事先并不知道会有多少图表,因为我是从网络的其他来源获取它们的。可能有数百个。

I'm developing an app where the user can purchase digital maps, charts and so on. I'd like to wrap these in in-app-purchases. The thing is that I don't know beforehand how many charts there will be, as I'm getting them from another source from the net. There could be hundreds.

我有一台服务器定期从该源获取图表并将其存储在本地;未来可能会出现新图表或现有图表消失。所有这些都没有人工干预。

I have a server that periodically gets the charts from that source and stores them locally; there may appear new charts in the future or disappear existing ones. All this without manual intervention.

有三种不同类型的图表。

There are three distinct types of charts.

我的第一个解决方案是创建三个消耗品并让用户购买;这工作正常,但不幸的是Apple拒绝了它,因为他们要求图表是非消费品。

My first solution was to create three consumable items and let the user buy these; this was working fine but unfortunately Apple rejected it, since they require charts to be "non consumable".

但是我很不知道如何实现我想要的非消耗型。如果我将这三种类型创建为非消耗品,并且用户购买了一种,他将免费获得该组中的所有其他图表,因为非消耗品只能购买一次。

But I'm quite at a loss how to implement what I want with the non-consumable type. If I create these three types as non-consumable, and the user buys one, he will get all the other charts in that group for free, since a non-consumable item can only be bought once.

我能想到的唯一解决方案是为每个图表创建一个非消耗品。但这是我想要不惜一切代价避免的事情:就像现在一样,图表会定期从远程源获取,而不需要任何手动工作。我想保持这种方式。我不想在每次出现新图表时手动创建新的非消耗品购买。

The only solution I can think of is to create a non-consumable item for every single chart. But that's something I want to avoid at all costs: as it is now, the charts are periodically fetched from the remote source without any manual work on my side. I'd like to keep it that way. I don't want to manually create a new non consumable purchases every time a new chart appears.

如何使这种可扩展性的想法?

Any ideas how to make this scalable?

推荐答案

我无法用代码完全拼出来,但你可以通过两种方式解决这个问题:

I can't completely spell it out for you with code but you can handle this problem two ways:

货币。
您不销售地图等非消耗品。你卖货币。使用该货币,您可以购买地图。每当用户点击您的商店前端时动态提供的地图。这样你只需要跟踪一些购买选项。

Currency. You do not sell non-consumable items such as maps. You sell currency. With that currency you purchase maps. The maps you feed dynamically whenever the user hits your store front. That way you only need to track a few purchase options.

另一种选择:
我工作的公司最初非常简单地设置了它。我们的应用程序将启动,我们将联系一个PHP脚本,将我们所拥有的应用程序商店ID交给我们。那时我们验证它们并使用有效的回报。此选项允许我们通过iTunes Connect更改我们的应用内购买,然后在脚本中更改一切都很棒。

The other option: The company I worked for initially set this up very simply. Our app would launch and we would reach out for a php script that handed us back the app store IDs that we had sitting in it. At that point we'd verify them and use the valid returns. This option allowed us to change our in app purchases through iTunes Connect and then in the script and everything was great.

这篇关于在App Purchase中:动态添加非消耗品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆