问题
Apple recently announced the ability to make purchases on the Apple Watch. I'm running Watch OS 6.2 and made a sandbox purchase on the iPhone, but there is no receipt on the watch (at least using Bundle.main.appStoreReceiptURL
code below) Do we have to handle passing the receipt from the iPhone to the Watch ourselves? My understanding was that there would be an equivalent receipt saved on the watch we could parse.
private func loadReceipt() -> Data? {
guard let url = Bundle.main.appStoreReceiptURL else {
return nil
}
do {
let data = try Data(contentsOf: url)
return data
} catch {
print("Error loading receipt data: \(error.localizedDescription)")
return nil
}
}
}
来源:https://stackoverflow.com/questions/60511143/storekit-implementation-on-apple-watch