-
-
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) On-device receipt validation/parsing #1184
base: master
Are you sure you want to change the base?
Conversation
@dpa99c I've read that OpenSSL adds several MB to the size of the app. Is this correct? If so, maybe the feature should be opt-in with an install-time flag? |
@j3k0 yeah, the OpenSSL iOS/arm64 framework weighs in at around 20Mb. |
Maybe the simplest solution is to maintain a separate branch? ( I wouldn't want my app to go from under 2MB (actual size of my test app on iOS) to 22MB for a feature I don't even need (when using a server-side validator or no validation at all). Maybe we can ask the cordova team if they have any other suggestions? |
Another option is to try to use the built-in iOS crypto libraries to do the pkcs7 decoding. That way we wouldn't need to include OpenSSL at all. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
e919dba
to
900c221
Compare
@j3k0 I've updated this PR branch onto your latest master branch and also made the inclusion of the iOS receipt validation functionality optional via a plugin variable: By default, it will not be enabled and therefore the large OpenSSL library will not be pulled into the app build. To enable the functionality, you must do so with a plugin variable at plugin installation time:
Since some references are made to the local validation classes in the Hopefully this should provide a way you will consider acceptable of make the functionality available to those who want it without adversely affecting other plugin users who don't want to use it. |
900c221
to
cbb7082
Compare
@j3k0 I've updated the PR branch to align with latest (v13) of the plugin - any reason not to merge this now? It's an opt-in feature so by default is disabled and the plugin will behave as it currently does, with the iOS receipt validation functionality stubbed out. It's only activated if the user installs the plugin with the specified plugin variable above. |
6cd9bb5
to
c610581
Compare
…ture (disabled by default) which is enabled via a plugin variable
c610581
to
4cda630
Compare
Hey @dpa99c - this is nice. I think this should be a separate plugin (the way braintree support is added to this plugin by installing "cordova-plugin-purchase-braintre"). This way there's no need to hack into the plugin xml file, which I think might backfire on non-pure cordova platforms (capacitor, monaca, ...) I'm busy finalizing another project, then I will look into this right after. |
@j3k0 I've tweaked the npm This allows it to work in a Capacitor project (which I have tested - not sure about Monaca) by adding the following block to
I looked into whether the dependency on OpenSSL could be eliminated by using the built-in iOS crypto libraries but unfortunately they don't support the PCKS7 operations required to decrypt the receipt. As to publishing this as a different plugin, that would require keep it in sync with the main plugin which isn't something I'd have to for, but maybe someone else is willing to take on that maintenance? |
why not merge this? Apple Store deprecated their [verifyreceipt], it would be good option |
Hello Do you have any working example code please ? For Auto renewable subscription, one product only, i just need the expiry date or also the purchase data will be ok.
cordova plugin add "https://github.com/dpa99c/cordova-plugin-purchase.git#ios_local_receipt" --variable LOCAL_RECEIPT_VALIDATION=true |
Changes proposed in this pull request (specific to iOS):
setBundleDetails()
API function to manually set bundle package name and version (rather than automatically trust the one in the app plist - see here)finish()
Reasoning:
TODO:
store
API, it just adds the functionality to the Objective-C and JS layers of the Cordova plugin API.To test this pull request with cordova: