saturngod / IAPHelper

No more maintenance for this repo. Please use the https://github.com/bizz84/SwiftyStoreKit
MIT License
1.55k stars 280 forks source link

Production variable should have failsafe when app is live #52

Open AlbertRenshaw opened 6 years ago

AlbertRenshaw commented 6 years ago

As it currently stands, if a dev forgets to set the production boolean to YES upon submitting for the AppStore issues can incur with receipt validation. (app will use Apple's sandbox verification server URL instead of their production verification server URL)

IAPHelper should utilize CLANG macros as a failsafe to automatically force that variable to YES if app is in release mode not debug mode.

#ifdef DEBUG
#define releaseBuild NO
#else
#define releaseBuild YES
#endif

Then in IAPHelper.m:

if (_production) {

Should now read:

if (_production || releaseBuild) {