Yes
1.I've added Transaction observer in my IAP helper classes while getting all products from iTunes.
2.Yes logged into same account.
3.When i call restoreCompletedTransaction then updatedTransaction method is calling with state restore and purchased also.I have copied purchased transaction original id and purchase id, After execution of the updatedTransaction method I'm validating recipt with APPLE API, there last object contains latest renewal record, purchase id is different from the transaction that i copied from the updatedTransaction method but, purchased_Date,end_Date and all are same.why there is a diff in id?
Below is the flow That I'm fallowing for auto-renewal.
Case 1:New User New device application installed 1st time Appstore a/c 1
When user registering first time app will make purchase with existing App Store credentials.
Every purchase will have transaction Id and original transaction Id.BE will store these details in subscriptionInfo.
When user purchasing we will store Original Transaction Id in defaults.
Every Appstore account will have different original Transaction Id.
*Case 2:Old User New/old device application installed 1st/2nd time Appstore a/c 1 with a existing plan*
When app installed in new device and old user tries to register, as the user already existed in our db, we will skip the subscription flow, old subscription plan will be applied, and will give access to the app if user is in valid subscription plan duration.If user is out of subscription we are showing subscription screen, forcing the user to subscribe again to continue.
App will restore the purchase if they are any purchases with App Store account which is in settings.will save Original Transaction Id in defaults.
*Case 3:*
Two user have two app credentials and two different Appstore Accounts.
User 1 Appstore a/c 1 and plan 30 days original id 1234, purchase id 2345 device 1
User 2 Appstore a/c 2 and plan 6 months originalId 9876 purchase Id 65675 device 2
When User1 Registered in device2 which have iTunesAccount2 in settings, will restore purchases and store the original Transaction Id in device.User1 will have another transactionId in subscriptionInfo, as both are different will show alert to user “Appstore account which is using to purchase a plan seems to be different with App Store account which is used previously to make purchase.Please use the same account or new account.”
Please let me know, if we can restrict the user to purchase, will apple allow this?