Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

ios - How to support multiple devices with non-renewing In-App Purchase?

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:

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.

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...