Closed gerard-morera closed 3 years ago
Hi @gerard-morera,
maybe an issue could be that you're not using the deprecated transactionReceipt
?
I think this gem only works this these kind of receipts.
I just checked, and for a old-school (deprecated) receipts the AppStore API returns data like this:
{
"receipt": {
"original_purchase_date_pst": "2020-05-10 11:12:36 America/Los_Angeles",
"unique_identifier": "UNIQUE_IDENTIFIER",
"original_transaction_id": "1234567",
"bvrs": "123456",
"app_item_id": "1234567",
"transaction_id": "1234567",
"quantity": "1",
"unique_vendor_identifier": "RANDOM-STRING",
"product_id": "the_product_id",
"item_id": "1234567",
"version_external_identifier": "1234567",
"bid": "the.bundle.id",
"is_in_intro_offer_period": "false",
"purchase_date_ms": "1589134356211",
"purchase_date": "2020-05-10 18:12:36 Etc/GMT",
"is_trial_period": "false",
"purchase_date_pst": "2020-05-10 11:12:36 America/Los_Angeles",
"original_purchase_date": "2020-05-10 18:12:36 Etc/GMT",
"original_purchase_date_ms": "1589134356211"
},
"status": 0
}
@gerard-morera I think you're using the more modern (or let us be honest: not fully deprecated) receipt of the app, which include all In-App-Purchases at once. Apple definitely encourages to use this approach. Sadly this gem has still no support for it.
Hi, @jnbt thanks for your fast answer. How can I ensure to receive the receipts on the supported format?
@gerard-morera The way I know is the following:
paymentQueue:updatedTransactions
paymentQueue:updatedTransactions
will be called with at least one transaction. For every transaction:
SKPaymentTransactionStatePurchased
transactionReceipt
base64EncodedStringWithOptions
I am not sure whether I am misusing the gem or there is a Bug.
From
apple_store#verify
I am receiving an instance ofCandyCheck::AppStoreReceipt
. When I try to access any of the public methods the return is nil.The reason is that the read method does not expect the receipt to be nested:
How the receipt is:
So basically to get the
product_id
. Instead ofwe would need:
Am I missing anything?
USAGE VERSION => 0.2.1
Thanks.