App store receipt URL not found on watchOS independent app targeting watchOS7+

Hi,

I'm trying to locate the app store receipt in the apple watch in order to send it to my server to verify.

I'm using the Original API for In-App Purchase because my app needs to support watchOS 7.0

My watchOS app is an independent app still pending to release to App Store. I'm testing using TestFlight, and I have one-month subscription in state "Ready to submit".

The process of purchase finishes fine in the apple watch -sandbox success screen- but then, when I invoke SKReceiptRefreshRequest in order to ask Apple for the Bundle.main.appStoreReceiptURL to download in my device and send it to my server to verify, I always get the following error:

<SKReceiptRefreshRequest: 0x16df52c0>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=507 "Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/IvooxAppleWatch%20WatchKit%20App.app/PlugIns/IvooxAppleWatch%20WatchKit%20Extension.appex/" UserInfo={NSDebugDescription=Invalid container for application: file:///private/var/containers/Bundle/Application/8BAF3B0E-45FC-465A-92E2-CFB1507A33E1/MyApp%20WatchKit%20App.app/PlugIns/MyApp%20WatchKit%20Extension.appex/}

And the receipt isn't there, in the path Bundle.main.appStoreReceiptURL. I tried looking for both receipt and sandboxReceipt. No luck. I even tried to list the contents of StoreKit but that directory does not exist on my watch according FileManager.

I cannot get rid of the error above. Any help is highly appreciated. Thanks in advance.

Thank you for reaching out. Could you please capture a sysdiagnose and any other information you have and file a feedback in Feedback Assistant, then post the FB number here.

Same here, this seems to have been happening since the WatchOS 9 release for StoreKit 1 API, but today I finally diagnosed it.

When ran in a debug build on a real WatchOS 9.1 watch, this is the error message:

2022-11-18 22:47:26.140173+0900 Weathergraph Watch Extension[438:63411] <SKReceiptRefreshRequest: 0x16515030>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=507 "Invalid container for application: file:///private/var/containers/Bundle/Application/4D199ED0-A419-44DD-BAB6-4C418926BD30/Weathergraph.app/PlugIns/Weathergraph%20Watch%20Extension.appex/" UserInfo={NSDebugDescription=Invalid container for application: file:///private/var/containers/Bundle/Application/4D199ED0-A419-44DD-BAB6-4C418926BD30/Weathergraph.app/PlugIns/Weathergraph%20Watch%20Extension.appex/, AMSServerErrorCode=0}

I added my info to FB11788741 (StoreKit 1 seems broken on WatchOS 9 & 9.1 - all purchase restores fail with StoreKit error 0) I sent previously.

Meanwhile I had to add this workaround for broken product purchase/restore on the watch:

  1. do the purchase or restore on the iPhone
  2. that syncs up the purchases to iCloud
  3. and later on the restore on the watch also fetches the purchases from the iCloud and uses those

I cannot migrate to StoreKit 2, as I have WatchOS 7 and iOS 14 as a baseline.

Has anybody gotten anywhere with this?

App store receipt URL not found on watchOS independent app targeting watchOS7+
 
 
Q