I am working on an Auto-renewable subscription based application. We are using In-App purchase (StoreKit) option for the payment. I have 2 subscription plans.
Monthly subscription
Yearly subscription
At the time of registration, the user should purchase any of the subscriptions mentioned above.
The problem I am facing can be stated as follows:
-> The Apple device is logged in using an iTunes id itunesone@gmail.com
-> One user say, userone@gmail.com creates an account in my app, and purchase a monthly subscription plan.
-> Now the purchased subscription is associated with iTunes id itunesone@gmail.com
-> Now, suppose if a second user say, usertwo@gmail.com tries to create another account with the same iTunes id itunesone@gmail.com
-> My requirement is that I should not allow the user to create a second account with the same iTunes id. How can I accomplish this?
-> If I allow the user to proceed and if the user tries to buy the same Monthly plan, apple store will return something like You are already subscribed to this plan. But if the user tries to purchase the second plan, that is the Yearly plan, An upgrade will happen which will completely mess up my backend.
-> Is there any way to get some data which will uniquely represent each iTunes id? So, using this I can solve my issue. Or else what I can do to stop the user from creating another account when there is already a subscription exists with the same iTunes id?
Note: Restore purchase was one option(not a good option, still). But it will confuse the user when there is a fresh registration happens and I don't think that is a good approach.