сервер По этой причине мне придется проверить квитанцию на стороне сервера. /p>
Код: Выделить всё
// Get the receipt if it's available.
if let appStoreReceiptURL = Bundle.main.appStoreReceiptURL,
FileManager.default.fileExists(atPath: appStoreReceiptURL.path) {
do {
let receiptData = try Data(contentsOf: appStoreReceiptURL, options: .alwaysMapped)
print(receiptData)
let receiptString = receiptData.base64EncodedString(options: [])
// Read receiptData.
}
catch { print("Couldn't read receipt data with error: " + error.localizedDescription)
}
}
Производство: https://buy.itunes.apple. com/veserifyReceipt
Sandbox: https://sandbox.itunes.apple.com/verifyReceipt
Я также также Прочитайте одну статью, и они предлагают использовать следующее: < /p>
Код: Выделить всё
switch try await product.purchase() {
case .success(let result):
let jws = result.jwsRepresentation
// send jws to your backend
< /code>
это правильный способ сделать? Кроме того, мой вопрос: следующая checiptData
Подробнее здесь: https://stackoverflow.com/questions/794 ... storekit-2