简体   繁体   English

iOS应用内购买+今日扩展小部件

[英]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. 所以我有一个需要订阅的应用程序(通过IAP),它提供了一个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. 在窗口小部件(以及应用程序内)中,我使用RMStore检查捆绑包中的App Receipt是否有活动订阅。 It works fine in the sandbox, including when installed via TestFlight. 它在沙盒中工作正常,包括通过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! 但是今天,该应用程序已获得Apple批准,一旦我测试了实时店内版本,当主应用程序看到用户在应用收据中购买时,今日扩展程序未读取应用程序收据,因此没有订阅!

Both the Today Extension and the main app are using the exact same code to read the app receipt and look for subscription information. Today Extension和主应用程序都使用完全相同的代码来阅读应用收据并查找订阅信息。 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? 它与RMStore而不是StoreKit本身有什么关系? 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? 我想也许问题可能与收据验证有关 - 例如,捆绑标识符在沙盒中与扩展的App Store不同吗?

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. 这真是令人沮丧,因为我没有办法测试任何可能的解决方案而不重新提交到App Store,然后在发布后对其进行测试,如果它被破坏则将其从商店中拉出来,否则我会让用户付费他们实际上没有得到的东西。

All receipts (app purchase and in-app purchase/s) are stored in a file inside the application bundle. 所有收据(应用程序购买和应用内购买/ s)都存储在应用程序包内的文件中。 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 ). 应用程序扩展名驻留在一个嵌套在应用程序包中的包中 - 所以如果它可以访问外部包中的收据文件(但值得通过调用appStoreReceiptURL检查),我会感到惊讶。

So information about the receipt (ie 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, ie using a shared container and maybe file coordination . 因此,有关收据的信息(即收据本身或处理收据的某些结果)需要通过常规方式从包含应用程序传递到扩展,即使用共享容器文件协调

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM