ℹ Please replace this with the version of SwiftyStoreKit you're using.
ℹ How to get Apple Receipt
ℹ I want to send apple receipt to server and also want see human readable receipt.
ℹ Please replace this with what you expected to happen.
ℹ Please replace this with what happened instead.
To get receipt data, use
if let receiptData = SwiftyStoreKit.localReceiptData {
let receiptDataAsString = receiptData.base64EncodedString(options: [])
}
or
if let receiptURL = Bundle.main.appStoreReceiptURL,
let receiptData = try? Data(contentsOf: receiptURL) {
let receiptDataAsString = receiptData.base64EncodedString(options: [])
}
In order to see human readable receipt content, you should use iTunes Store to parse the receipt, as iTunes Store is the only source of truth when dealing with subscriptions. https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html
You should make a request to https://buy.itunes.apple.com/verifyReceipt with your receipt data to get the receipt content.
@ashishfission @mihai8804858 I would also recommend to read the Receipt Verification section.
To get a human readable receipt in SwiftyStoreKit, you can use the verifyReceipt() method.
Closing this. Feel free to reopen if you have any more questions.