[AC-1744] Ti.Storekit: receiptVerificationSandbox always TRUE if set
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-22T21:41:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | store, storekit |
Reporter | Fokke Zandbergen |
Assignee | Shak Hossain |
Created | 2013-05-22T14:43:33.000+0000 |
Updated | 2016-03-08T07:40:37.000+0000 |
Description
Consider the following tests:
var Storekit = require('ti.storekit');
Ti.API.error('Storekit.receiptVerificationSandbox: (' + (typeof Storekit.receiptVerificationSandbox) + ') ' + Storekit.receiptVerificationSandbox);
Storekit.receiptVerificationSandbox = false;
Ti.API.error('Storekit.receiptVerificationSandbox: (' + (typeof Storekit.receiptVerificationSandbox) + ') ' + Storekit.receiptVerificationSandbox);
Storekit.receiptVerificationSandbox = true;
Ti.API.error('Storekit.receiptVerificationSandbox: (' + (typeof Storekit.receiptVerificationSandbox) + ') ' + Storekit.receiptVerificationSandbox);
Storekit.receiptVerificationSandbox = 0;
Ti.API.error('Storekit.receiptVerificationSandbox: (' + (typeof Storekit.receiptVerificationSandbox) + ') ' + Storekit.receiptVerificationSandbox);
Storekit.receiptVerificationSandbox = 1;
Ti.API.error('Storekit.receiptVerificationSandbox: (' + (typeof Storekit.receiptVerificationSandbox) + ') ' + Storekit.receiptVerificationSandbox);
Resulting in the following outcome:
May 22 16:09:19 iPad VerhaaltjesApp[9707] <Warning>: [ERROR] Storekit.receiptVerificationSandbox: (number) 0
May 22 16:09:19 iPad VerhaaltjesApp[9707] <Warning>: [ERROR] Storekit.receiptVerificationSandbox: (boolean) true
May 22 16:09:19 iPad VerhaaltjesApp[9707] <Warning>: [ERROR] Storekit.receiptVerificationSandbox: (boolean) true
May 22 16:09:19 iPad VerhaaltjesApp[9707] <Warning>: [ERROR] Storekit.receiptVerificationSandbox: (boolean) true
May 22 16:09:19 iPad VerhaaltjesApp[9707] <Warning>: [ERROR] Storekit.receiptVerificationSandbox: (boolean) true
In the docs and example code of the module it says receiptVerificationSandbox
is a boolean
and defaults to false
. The tests above show it's a number
, that defaults to 0
but changes to a boolean
with value TRUE
if you change it to *whatever* value!
This means if you do something like:
Storekit.receiptVerificationSandbox = (Ti.App.deployType !== 'production');
Storekit.receiptVerificationSandbox = Alloy.CFG.receiptVerificationSandbox;
Receipts will *always* be verified against the sandbox!
Since you will not know this before the app has been approved (and yes, it will be) this is an extremely critical issue that should be fixed soon.
Although it is advised by both Apple and Appcelerator to verify receipts on your own back-end server, the in-app verification should and must work - correctly.
Fixed issue in module with incorrect property type. Updated module (version 2.0.2) will be in the MarketPlace shortly.
Thanks for your quick response. I see you now have this line in the
app.js
:You probably took this from my example, but this test is not valid :) The
Ti.App.deployType
can also beproduction
if the app is *not* distributed via the App Store, e.g. Ad Hoc. I don't know if there is any way to detect if the app is distributed via the App Store. If so, then thereceiptVerificationSandbox
could be removed completely and handled internally.Hi, So, now Storekit.receiptVerificationSandbox is real boolean. Good :) But, did you manage how to make it work during Apple's review??
I just removed setting
receiptVerificationSandbox
, since its default isfalse
.Hi Fokke Zandbergen, I believe this is fixed. Please let me know if this ticket can be closed. Thanks, Shak
Yeo, was fixed indeed