-
-
Notifications
You must be signed in to change notification settings - Fork 535
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] getting receipt type application in store.validator #1398
Comments
I'm also getting TypeError: undefined is not an object (evaluating 'callback.name') on function safeCall(logger, className, callback, value) { |
I have the same problem in Will it work correctly if I validate the receipt type |
I also have the same problem in And, the approved product is the product that I wanted to buy, but the request body contains a product with type I think it's because this part (https://github.com/j3k0/cordova-plugin-purchase/blob/b402df92ca4649d142deb162082f851578df0144/src/ts/platforms/apple-appstore/appstore-adapter.ts#L654C17-L664C18) has id |
hi @asaf-interator @sjquant did you guys got any resolution? |
I currently have it working with something like this: Request purchase: userRequestedAdsPurchase = true;
store.order(store.get('my_subscription_name').getOffer(), {developerPayload: {}}); And in the validation function: function storeValidator(receipt, callback)
{
// Only validate type APPLICATION if the user has requested the purchase and not when opening the app
if(receipt.type != CdvPurchase.ProductType.APPLICATION || (window.cordova.platformId == 'ios' && userRequestedAdsPurchase))
{
// Validate purchase code here, example:
let xError = checkReceiptInServer(receipt);
if(xError)
{
callback({
ok: false,
code: CdvPurchase.ErrorCode.CLIENT_INVALID,
message: 'Error message',
})
}
else
{
callback({ok: true, data: receipt.transaction});
}
// Reset userRequestedAdsPurchase
userRequestedAdsPurchase = false;
}
else
{
// Try run always callback to avoid errors in iOS
if(window.cordova.platformId == 'ios')
callback({ok: true, data: receipt.transaction});
}
} |
See my reply here, this seems to be related: #1428 (comment) Before in v11, the handlers (on iOS) only ever triggered for your pre-defined product ids. Now the handlers also trigger for the application itself, because apparently, the application is part of the transaction history. Solution is to filter in your |
Observed behavior
Trying to update to v13.3.11 from V11.0.0
On iOS when trying to purchase a subscription I'm getting receipt type application in the store.validator even through I'm not subscribing this product id and it's not the product id I'm using to order.
On Android it seems to be working well.
Expected behavior
Getting the right id and type of product in the receipt in the store.validator
System Info
Cordova Packages:
cli: 11.1.0
common: 4.1.0
create: 4.1.0
lib: 11.1.0
common: 4.1.0
fetch: 3.1.0
serve: 4.0.1
Project Installed Platforms:
android: 11.0.0
ios: 6.2.0
Project Installed Plugins:
cordova-plugin-actionsheet: 2.3.3
cordova-plugin-androidx-adapter: 1.1.3
cordova-plugin-appsflyer-sdk: 6.8.2-rc1
cordova-plugin-camera: 6.0.0
cordova-plugin-customurlscheme: 5.0.1
cordova-plugin-datepicker: 0.9.3
cordova-plugin-device: 2.1.0
cordova-plugin-dialogs: 2.0.2
cordova-plugin-file: 7.0.0
cordova-plugin-firebasex: 16.0.0-cli
cordova-plugin-inappbrowser: 5.0.0
cordova-plugin-insomnia: 4.3.0
cordova-plugin-intercom: 12.1.0
cordova-plugin-ionic-keyboard: 2.2.0
cordova-plugin-ionic-webview: 5.0.0
cordova-plugin-listpicker: 2.2.2
cordova-plugin-media: 6.1.0
cordova-plugin-network-information: 3.0.0
cordova-plugin-opentok: 3.4.3
cordova-plugin-proguard: 2.2.0
cordova-plugin-purchase: 13.3.11
cordova-plugin-statusbar: 3.0.0
cordova-plugin-whitelist: 1.3.5
cordova-universal-links-plugin-fixed: 1.2.1
cordova.plugins.diagnostic: 7.1.1
onesignal-cordova-plugin: 3.3.1
Environment:
OS: macOS Monterey 12.6.3 (21G419) (darwin 21.6.0) x64
Node: v16.15.0
npm: 8.10.0
ios Environment:
xcodebuild:
Xcode 14.2
Build version 14C18
The text was updated successfully, but these errors were encountered: