You need a database that synchronizes with your userdefault. You can sync however frequent you want. so that when a user purchases your database is notified and when a cancelation is done. your database is also notified. which then tell your userdefault that the user has opted out of your purchase. See the rough sketch below.