|ReleasedLast Release||Aug 2017|
Maintained by Luka Mirosevic.
|LOCLines of Code||180|
Simple iOS and Mac OS X feature manager for unlocking functionality (e.g. for IAP purchases).
Unlock a feature (all features are locked by default):
Lock a feature:
Check to see if a feature is unlocked:
[GBFeatureManager isFeatureUnlocked:@"speedBoost"]; //Returns: YES or NO
If you want to unlock all features + any future features, think of it as an "all features unlocked override" (N.B. this will supersede any individual setting):
To turn off the "all features unlocked override":
To enabled features by default (e.g. Pro version), you can unlock some features directly in the Info.plist by adding it as a key to the Plist, prefixed by
GBFeatureManager: and setting the value to a Boolean.
...normally you would do this in Xcode's Plist editor by simply adding a new row with the key
GBFeatureManager:com.goonbee.proVersion, setting the type to
Boolean and the value to either
Don't forget to import header, for iOS:
... or on OSX:
Features are each stored to disk in simple serialized NSNumber objects to the NSDocumentsDirectory on iOS, or NSApplicationSupportDirectory OS X.
When checking whether a feature is available, the disk is only accessed the first time, and the result is cached in memory, subsequent checks never hit the disk.
iOS: Add to your project's workspace, add dependency for GBToolbox-iOS and GBStorageController-iOS, link with your binary, add -ObjC linker flag, add header search path.
OS X: Add to your project's workspace, add dependency for GBToolbox-OSX and GBStorageController-OSX, link with your binary, add "copy file" step to copy framework into bundle.
Copyright 2013 Luka Mirosevic
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.