For the initial subscription purchase:
- User initiates a purchase on the iDevice
- Device contacts Apple, Apple issues a receipt and sends it back to the device
- The device sends the receipt to my server
- The server validates that the receipt is legit through Apple's receipt validation API
- Once the receipt is validated, the server stores it in my DB
- The server responds to the app saying it's all good
To keep the server in sync with the iTunes subscription:
- Setup a cron job to retrieve expiring receipts from the DB on a daily basis or something
- Validate each receipt with Apple
- Apple will respond with an updated version of the receipt that contains details regarding whether or not the subscription was canceled/renewed/etc.
- Server replaces the original receipt with this updated version in the DB
Now if someone logs into their account on a Roku or some other device, the subscription can be honored because my DB is the source of truth.