Latest 1.5
License MIT
Platforms ios 9.3, osx 10.11, requires ARC
Dependencies SAMKeychain

Build Status Carthage compatible Cocoapods compatible License: MIT

In-app purchase helper and UI elements




To use PurchaseHelper with CocoaPods, add the following line to your Podfile:

pod 'PurchaseHelper'


To use PurchaseHelper with Carthage, add the following line to your Cartfile:

github "exsortis/PurchaseHelper"


Instantiate the helper once, and keep a strong reference to it somewhere.

NSSet<NSString*>* productIds = [NSSet setWithObjects:@"product1", @"product2", @"product3", nil];
PurchaseHelper* helper = [[PurchaseHelper alloc] initWithProductIdentifiers:productIds keychainAccount:@"MyIAPs"];

Buy a product:

[helper buyProduct:@"product2"];

And check if a product was bought:

if([helper productPurchased:@"product3"]) {
    // show some feature
else {
    // encourage the user to buy this feature

Restore completed transactions:

[helper restoreCompletedTransactions];


Create the view controller, providing it a reference to the helper. Customize its appearance, then display it.

PurchasesViewController* vc = [PurchasesViewController new];
vc.purchaseHelper = helper;

vc.titleFont = appTitleFont;
vc.buttonFont = appButtonFont;

[self presentViewController:purchasesVC animated:YES completion:nil];

If your app needs to know when the purchase completed, setup a notification observer:

[[NSNotificationCenter defaultCenter] addObserverForName:ProductPurchasedNotification object:nil queue:nil usingBlock:^(NSNotification* note){
    NSString* productId = note.userInfo[ProductPurchasedNotificationProductIdentifierKey];
    // do something with the notification

Test mode

Place the helper in test mode when testing the application’s in-app purchase functionality.

helper.testMode = YES;


Copyright 2016-7 Pilgrimage Software


See LICENSE for details.

Latest podspec

    "name": "PurchaseHelper",
    "version": "1.5",
    "summary": "In-app purchase helper and UI elements",
    "description": "Some helper classes for managing in-app purchases,nincluding some UI elements.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Paul Schifferer": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "9.3",
        "osx": "10.11"
    "source": {
        "git": "",
        "tag": "1.5"
    "source_files": "PurchaseHelper/**/*.{h,m}",
    "resources": [
    "ios": {
        "resources": [
    "exclude_files": "Classes/Exclude",
    "public_header_files": "PurchaseHelper/*.h",
    "private_header_files": "PurchaseHelper/Private/*.h",
    "requires_arc": true,
    "dependencies": {
        "SAMKeychain": []

Pin It on Pinterest

Share This