Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS purchase popup trigger multiple times #1525

Open
selcukbeyhan opened this issue Feb 11, 2024 · 1 comment
Open

iOS purchase popup trigger multiple times #1525

selcukbeyhan opened this issue Feb 11, 2024 · 1 comment

Comments

@selcukbeyhan
Copy link

Observed behavior

The CdvPurchase.store.when().receiptUpdated is called continuously and CdvPurchase.store.when().approved never called.

Include logs with CdvPurchase.store.verbosity = CdvPurchase.LogLevel.DEBUG
⚡️ [log] - [CdvPurchase] INFO: order(MYAPP_1_MONTHLY_SUBSCRIPTION)
To Native Cordova -> InAppPurchase purchase InAppPurchase1121316625 ⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: order
["options": [MYAPP_1_MONTHLY_SUBSCRIPTION, 1, , {
}]]
[CdvPurchase.AppleAppStore.objc] purchase: About to do IAP
[CdvPurchase.AppleAppStore.objc] paymentQueue:updatedTransactions: MYAPP_1_MONTHLY_SUBSCRIPTION
[CdvPurchase.AppleAppStore.objc] paymentQueue:updatedTransactions: Purchasing...
[CdvPurchase.AppleAppStore.objc] paymentQueue:updatedTransactions: State: PaymentTransactionStatePurchasing
[CdvPurchase.AppleAppStore.objc] processTransactionUpdate:withArgs: transactionIdentifier=
⚡️ [log] - [CdvPurchase.AppleAppStore.Bridge] DEBUG: Purchase enqueued MYAPP_1_MONTHLY_SUBSCRIPTION
⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: purchaseEnqueued: MYAPP_1_MONTHLY_SUBSCRIPTION - 1
⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: order.success
⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: receiptsUpdated: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"initiated","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}]
⚡️ [log] - [CdvPurchase.AppleAppStore.Bridge] DEBUG: transaction updated: state:PaymentTransactionStatePurchasing product:MYAPP_1_MONTHLY_SUBSCRIPTION
⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: purchasing: MYAPP_1_MONTHLY_SUBSCRIPTION
⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: receiptsUpdated: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"initiated","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}]
⚡️ [log] - [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=#1558798c200b4c113a056b073e8523df reason=adapterListener_receiptsUpdated
⚡️ [log] - MYAPP Receipt is updated
⚡️ [log] - [CdvPurchase] INFO: verify(Receipt)
⚡️ [log] - [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"initiated","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}
⚡️ [log] - [CdvPurchase.Validator] DEBUG: Validation requests=2 responses=1
⚡️ [log] - [CdvPurchase] INFO: finish(Receipt)
⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: finish(virtual.MYAPP_1_MONTHLY_SUBSCRIPTION)
⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: receiptsUpdated: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"finished","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}]
⚡️ [log] - [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=#1558798c200b4c113a056b073e8523df reason=adapterListener_receiptsUpdated
⚡️ [log] - MYAPP Receipt is updated
⚡️ [log] - [CdvPurchase] INFO: verify(Receipt)
⚡️ [log] - [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"finished","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}
⚡️ [log] - [CdvPurchase] INFO: finish(Receipt)
⚡️ [log] - [CdvPurchase.AppleAppStore] INFO: finish(virtual.MYAPP_1_MONTHLY_SUBSCRIPTION)
⚡️ [log] - [CdvPurchase.AdapterListener] DEBUG: receiptsUpdated: [{"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"finished","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}]
⚡️ [log] - [CdvPurchase] DEBUG: Calling callback: type=receiptUpdated() name=#1558798c200b4c113a056b073e8523df reason=adapterListener_receiptsUpdated
⚡️ [log] - MYAPP Receipt is updated
⚡️ [log] - [CdvPurchase] INFO: verify(Receipt)
⚡️ [log] - [CdvPurchase.Validator] DEBUG: Schedule validation: {"className":"Receipt","transactions":[{"className":"Transaction","transactionId":"virtual.MYAPP_1_MONTHLY_SUBSCRIPTION","state":"finished","products":[{"id":"MYAPP_1_MONTHLY_SUBSCRIPTION"}],"platform":"ios-appstore"}],"platform":"ios-appstore"}
⚡️ [log] - [CdvPurchase] INFO: finish(Receipt)

Expected behavior

I would assume that when the user confirms the subscription on the device, the method "CdvPurchase.store.when().approved" should be called. However, it is never called and the method "CdvPurchase.store.when().receiptUpdated" is called continuously.
The app continuously asks for confirmation of purchase.

This seems to be similar to the issue #1513 but the suggestion about the storekit file didnt work neither. There is no such instruction in the documentation.

@mustaqt
Copy link

mustaqt commented May 30, 2024

I am facing the same issue.
I can get all the products details but approved never get fired after initiating the purchase.
Purchase popup keep appearing in xcode simulator.
It never fires approved even on device however I do get validator endpoint call on my serve from apple when I initiate the purchase on device which does t ask the purchase pop up again but I cant link my app user to that receipt via apple call. I need to have approved call back so I can call my api to link the app user to the subscription.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants