如何使用不续订的应用程序内购买支持多个设备?

时间:2023-01-12 22:06:30

I'm building an iOS app that will include an IAP with a non-renewing subscription. Apple provides this nugget in their overview of IAP:

我正在构建一个iOS应用程序,其中包含一个不续订的IAP。 Apple在他们的IAP概述中提供了这个金块:

You are required to deliver non-renewing subscriptions to all devices owned by the user. Non-renewing subscriptions are not automatically synchronized to all devices by Store Kit; you must implement this infrastructure yourself. For example, most subscriptions are provided by an external server; your server would need to implement a mechanism to identify users and associate subscription purchases with the user who purchased them.

您需要向用户拥有的所有设备提供非续订订阅。 Store Kit不会自动将未续订订阅同步到所有设备;你必须自己实现这个基础设施。例如,大多数订阅由外部服务器提供;您的服务器需要实施一种机制来识别用户并将订购购买与购买它们的用户相关联。

I would like to follow this rule: I want my users to be able to take advantage of the subscription they purchase on one device on other devices as well. So how can I identify the same user across their iPhone and iPad? I understand that you can't use the Apple ID, and you can't rely on a registration method.

我想遵循这条规则:我希望我的用户能够利用他们在其他设备上的一台设备上购买的订阅。那么如何在iPhone和iPad上识别同一个用户呢?我知道您不能使用Apple ID,也不能依赖注册方法。

I just now found this question; the answer given there doesn't appear to be workable. There must be something more elegant that others have done.

我刚才发现了这个问题;那里给出的答案似乎不可行。其他人必须有更优雅的东西。

4 个解决方案

#1


3  

I have a suggestion given to me from Gavin McKenzie, which sounds like the best bet I've heard:

我从Gavin McKenzie那里得到了一个建议,这听起来像我听过的最好的赌注:

Upon purchase of the subscription, make a "short code" available to the user. The code would be stored on the server as well, tied to that user's account. When they hit Restore on another device, request the short code from the original device and account, thereby tying those devices together.

购买订阅后,为用户提供“短代码”。代码也将存储在服务器上,与该用户的帐户绑定。当他们在另一台设备上点击“恢复”时,请从原始设备和帐户请求短代码,从而将这些设备绑在一起。

Gavin further suggested the use of this in a "pairing" method similar to Bluetooth: when restoring, initiate the pairing on Device A, which generates the short code and pushes it to the server. Device B can then use that code. Five minutes later, or when the pairing screen is dismissed, the code is deleted.

Gavin进一步建议在类似于蓝牙的“配对”方法中使用它:在恢复时,启动设备A上的配对,设备A生成短代码并将其推送到服务器。然后,设备B可以使用该代码。五分钟后,或者当配对屏幕被解除时,代码被删除。

I'm not sure how this would stand up if you want to restore to the same device, say, after deleting the phone and restoring. But this feels like a good start.

如果您想要恢复到同一设备,比如删除手机并恢复后,我不确定这会如何起作用。但这感觉是一个好的开始。

#2


0  

If you can drop support for iOS below version 5.0, you could use iCloud to sync a key-value pair across user's devices.

如果您可以放弃iOS 5.0以下的支持,则可以使用iCloud在用户设备上同步键值对。

#3


0  

See this:

http://iphonedevsdk.com/forum/business-legal-app-store/88698-floored-by-new-rejection.html

Apparently you can require a username/password before purchase. It's really the only way that makes sense. A code can be shared by thousands of people, which is bad.

显然,您在购买前可能需要用户名/密码。这是唯一有道理的方法。代码可以由成千上万的人共享,这很糟糕。

#4


0  

Check out Frac.as. It does a variant of the "short code" pairing suggested above, but with some built in smarts to prevent abuse. It's a SaaS API, with a generous free tier.

看看Frac.as.它做了上面提到的“短代码”配对的变体,但有一些内置的智能防止滥用。它是一个SaaS API,具有丰富的免费等级。

#1


3  

I have a suggestion given to me from Gavin McKenzie, which sounds like the best bet I've heard:

我从Gavin McKenzie那里得到了一个建议,这听起来像我听过的最好的赌注:

Upon purchase of the subscription, make a "short code" available to the user. The code would be stored on the server as well, tied to that user's account. When they hit Restore on another device, request the short code from the original device and account, thereby tying those devices together.

购买订阅后,为用户提供“短代码”。代码也将存储在服务器上,与该用户的帐户绑定。当他们在另一台设备上点击“恢复”时,请从原始设备和帐户请求短代码,从而将这些设备绑在一起。

Gavin further suggested the use of this in a "pairing" method similar to Bluetooth: when restoring, initiate the pairing on Device A, which generates the short code and pushes it to the server. Device B can then use that code. Five minutes later, or when the pairing screen is dismissed, the code is deleted.

Gavin进一步建议在类似于蓝牙的“配对”方法中使用它:在恢复时,启动设备A上的配对,设备A生成短代码并将其推送到服务器。然后,设备B可以使用该代码。五分钟后,或者当配对屏幕被解除时,代码被删除。

I'm not sure how this would stand up if you want to restore to the same device, say, after deleting the phone and restoring. But this feels like a good start.

如果您想要恢复到同一设备,比如删除手机并恢复后,我不确定这会如何起作用。但这感觉是一个好的开始。

#2


0  

If you can drop support for iOS below version 5.0, you could use iCloud to sync a key-value pair across user's devices.

如果您可以放弃iOS 5.0以下的支持,则可以使用iCloud在用户设备上同步键值对。

#3


0  

See this:

http://iphonedevsdk.com/forum/business-legal-app-store/88698-floored-by-new-rejection.html

Apparently you can require a username/password before purchase. It's really the only way that makes sense. A code can be shared by thousands of people, which is bad.

显然,您在购买前可能需要用户名/密码。这是唯一有道理的方法。代码可以由成千上万的人共享,这很糟糕。

#4


0  

Check out Frac.as. It does a variant of the "short code" pairing suggested above, but with some built in smarts to prevent abuse. It's a SaaS API, with a generous free tier.

看看Frac.as.它做了上面提到的“短代码”配对的变体,但有一些内置的智能防止滥用。它是一个SaaS API,具有丰富的免费等级。