Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS in-app-purchase + Today Extension widget

So I have an app which requires a subscription (via an IAP), and it provides a Today Widget. Within the widget (as well as within the app) I use RMStore to check the App Receipt in the bundle for an active subscription. It works fine in the sandbox, including when installed via TestFlight. But today, the app was approved by Apple, and as soon as I tested the live-in-the-store version, while the main app saw the user's purchases in the app receipt, the Today Extension wasn't reading the app receipt, and thus found no subscription!

Both the Today Extension and the main app are using the exact same code to read the app receipt and look for subscription information. Why on earth would it work in the main app but not the extension? Is this a known issue? Is it something to do with RMStore rather than StoreKit itself? Is there something clever/different I have to do?

I'm thinking maybe the issue has to do with the receipt verification -- would something like the bundle identifier be different in the sandbox vs the App Store for the extension, for example?

This is really frustrating, as there's literally no way for me to test any potential solution without resubmitting to the App Store, then testing it once it's released, and pulling it from the store if it's broken, as otherwise I'll have users paying for something they don't actually get.

like image 911
DanM Avatar asked May 20 '15 13:05

DanM


1 Answers

All receipts (app purchase and in-app purchase/s) are stored in a file inside the application bundle. The app extension resides in a bundle that's nested inside the application bundle - so I would be surprised if it has access to the receipt file in the outer bundle (but worth checking by calling appStoreReceiptURL).

So information about the receipt (i.e. either the receipt itself, or some result of processing the receipt) needs to be passed from the containing app to the extension through the usual means, i.e. using a shared container and maybe file coordination.

like image 75
roop Avatar answered Oct 22 '22 12:10

roop