A framework to add patronage to your apps.

Overview

Promo - Click to see larger version.

PatronKit

A framework for add a patronage area to your apps.

PatronKit uses CloudKit to record purchases, and then display tallies back to the user. It also shows the user when their patronage expires. This encourages users to donate frequently, hopefully rewarding you for your work.

Features:

  • Offer patronage purchases to your users in a pre-built UI (This UI is going to change in a near-future release.)
  • Track when a users patronage expires
  • Showing how many users already donated
  • Show how many reviews there are for the current app version. (You have to implement the UI for this by yourself, but fetching the number is built in to PatronManager)

Requirements:

PatronKit was written with Swift 2 in Xcode 7.2. You can run it on iOS 8.0 or later. If you need to support iOS 7, use the raw Swift files (and storyboard) instead of the framework.

Installation & Usage:

There are five steps to use PatronKit:

  1. Include the framework in your project
  2. Configure your project to use CloudKit
  3. Configure In-App Purchases
  4. Tell PatronKit about your In-App Purchase identifiers
  5. Present an instance of PatronageViewController

Step 1: Including PatronKit in Your Project

PatronKit is a dynamic framework, so you should drag the Xcode project into your own, and link against it. PatronKit doesn't support CocoaPods at this time. The usual disclaimers about Swift Package Manager being a work in progress apply.

PatronKit is written in Swift, so an import is all you need to access it. You can use it in both Swift and Objective-C projects.

Swift:

import PatronKit

Objective-C:

@import PatronKit;

Note: If you run into issues with XCTest, please double check that Xcode isn't compiling the PatronKit Swift files as part of your app target.

Step 2: Configuring CloudKit

To set up CloudKit, open the Capabilities tab in Xcode and enable CloudKit. PatronKit uses the default container and record zone for storing patronage data, so you should only need to flip the switch.

CloudKit

Step 3: Configuring In-App Purchases

You should create a few in-app purchase products with the "consumable" type. The identifiers should be a reverse-domain style identifier ending with a number. This number is the length of the patronage offered by the product, in months. For example, com.mosheberman.patronapp.3 offers three months of patronage.

IAPs

Step 4: Tell PatronKit about your In-App Purchases.

You do this by passing the PatronManager an NSSet with your product identifiers, like so:

Swift:

let identifiers: Set = Set(arrayLiteral: ["com.patronkit.3", "com.patronkit.6", "com.patronkit.12"])
PatronManager.sharedManager.productIdentifiers = identifiers

Objective-C:

NSSet *identifiers = [NSSet setWithArray:@[@"com.patronkit.3", @"com.patronkit.6", @"com.patronkit.12"]];
[[PatronManager sharedManager] setProductIdentifiers:identifiers;

At this point, you're all set up. PatronKit will sort the identifiers for you when it displays the products, from smallest number of months to largest. Now, we just need to show our users the patronage options.

Step 5: Showing a Patronage View Controller

PatronageViewController subclasses UITableViewController, so you can present it as you wish. (For example, present it modally, or puh it onto a UINavigationController stack. If you present it modally, you'll have to provide your own dismissal method.)

Getting App Review Counts:

Optionally, you can get the number of reviews of your app on the App Store by passing your Apple app ID to PatronManager, by setting the appID property:

Swift:

PatronManager.sharedManager.appID = "xxxxxx"

Objective-C:

PatronManager.sharedManager.appID = @"xxxxxx"

To Do:

  • Clever things to make the patron count look good
  • Show the review count somewhere

What is Patronage?

If you've read this far, you probably already want to try patronage in your app.

Patronage is a model where everything in your app is free, but users can donate and become "patrons." For a really good explanation, download Overcast, and look at Marco's reasoning.

Thanks:

Marco Arment for providing the inspiration for this framework, as well as some guidence in the initial implementation.

License:

MIT. Please feel free to let me know if you've used this in your app and how it works for you.

You might also like...
Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks.

Implement donate to Ukraine inside your app, with Apple Pay
Implement donate to Ukraine inside your app, with Apple Pay

DonateToUkraine gives you a simple way to provide "donate to Ukraine" functionality in your app via an official donation service (endorsed here). The service will be opened inside the app, keeping a native feel. Apple Pay is supported.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

Add to-do List  - a mobile application where you can add your to-dos and follow them
Add to-do List - a mobile application where you can add your to-dos and follow them

This project, is a mobile application where you can add your to-dos and follow them. You can add your to-do's.

BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.
BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.

BottomSheet About BottomSheet BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps. The result can look like this...or completel

BottomSheet lets you add custom bottom sheets to your SwiftUI apps.
BottomSheet lets you add custom bottom sheets to your SwiftUI apps.

BottomSheet lets you add custom bottom sheets to your SwiftUI apps.

Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once.

This is a fork from the famous SVPullToRefresh pod with 2 additional functionalities: Can add multiple pull-to-refresh views into one single UIScrollV

Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.

Katana is a modern Swift framework for writing iOS applications' business logic that are testable and easy to reason about. Katana is strongly inspire

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms

SwiftUI-compatible framework for building browser apps with WebAssembly At the moment Tokamak implements a very basic subset of SwiftUI. Its DOM rende

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms

SwiftUI-compatible framework for building browser apps with WebAssembly At the moment Tokamak implements a very basic subset of SwiftUI. Its DOM rende

Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.
Swift Apps in a Swoosh! A modern framework for creating iOS apps, inspired by Redux.

Katana is a modern Swift framework for writing iOS applications' business logic that are testable and easy to reason about. Katana is strongly inspire

Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.  ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.
ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Since Facebook introduced reactions in 2016, it became a standard in several applications as a way for users to interact with content. ReactionButton is a control that allows developers to add this functionality to their apps in an easy way.

Panels is a framework to easily add sliding panels to your application
Panels is a framework to easily add sliding panels to your application

Panels is a framework to easily add sliding panels to your application. It takes care of the safe area in new devices and moving your panel when the k

ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects.
ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects.

ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects. The kit provides variety of customisations inorder to design a confetti which matches your project's UI. ConfettiKit makes your work of adding Confetti on your project with just one line of code.

A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites

A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites. The aim of the project is to learn the use of Core Data.

Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using native Android/iOS.

AgilityFitTodayApp Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using nati

Vaccine is a framework that aims to make your apps immune to recompile-disease.
Vaccine is a framework that aims to make your apps immune to recompile-disease.

Vaccine Description Vaccine is a framework that aims to make your apps immune to recompile-disease. Vaccine provides a straightforward way to make you

Comments
  • Integrate with SwiftyStoreKit

    Integrate with SwiftyStoreKit

    Instead of handling all of the store kit part, it might be beneficial to use SwiftyStoreKit and then this library can focus on saving users to the cloud and displaying that data maybe?

    https://github.com/bizz84/SwiftyStoreKit

    opened by MaxHasADHD 4
  • Price needs to be localized

    Price needs to be localized

    When converting the product price into a string, the locale needs to be set for the number formatter, so that it uses the correct currency format of the user's iTunes Store:

                [self.numberFormatter setLocale:product.priceLocale];
    
    enhancement 
    opened by mrlegowatch 2
  • Compatibility issue with Swift 3.0.1

    Compatibility issue with Swift 3.0.1

    I'm trying to get PatronKit imported on a Swift 3.0.1 project and after the project linking, I get this error at the import PatronKit line.

    Module compiled with Swift 2.3 cannot be imported in Swift 3.0.1:

    opened by perteraul 0
  • Support for iOS 11 Featured IAPs

    Support for iOS 11 Featured IAPs

    iOS 11 adds a new mechanism for allowing users to purchase IAPs right in the App Store. There's a few small steps we need to take to support that.

    • [ ] Adopt the new SKPaymentTransactionQueueDelegate method.
    • [ ] Adopters need to add iTunes Artwork, so link the relevant Apple docs. Update README to point to relevant Apple documentation.
    enhancement 
    opened by MosheBerman 1
Owner
Moshe
Self-care, family, code.
Moshe
Integrate Ios framework with anther framework

Puppy Paradise This project is a sample usage of my AOModalStatusView framework. When running, this application will show pictures of puppies and prov

null 0 Dec 10, 2021
card.io provides fast, easy credit card scanning in mobile apps

card.io SDK for iOS card.io provides fast, easy credit card scanning in mobile apps. NEW!!! card.io is now an open-source project! As of December 2014

card.io 2.3k Jan 4, 2023
Easy, drop-in tip jar for iOS apps.

Installation TipJarViewController is available through CocoaPods. To install it, simply add the following line to your Podfile: pod 'TipJarViewControl

Lionheart Software 79 Apr 27, 2022
OnTime - OnTime App is for Scheduling your day and prioritizing your task and also for saving notes

OnTime OnTime App is for Scheduling your day and prioritizing your task and also

Mohammed Sulaiman 1 Jan 7, 2023
Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺

SwiftyStoreKit is a lightweight In App Purchases framework for iOS, tvOS, watchOS, macOS, and Mac Catalyst. Features Super easy-to-use block-based API

Andrea Bizzotto 6.1k Jan 7, 2023
In App Purchase Manager framework for iOS

InAppFramework In App Purchase Manager framework for iOS Disclaimer I know it's been too long since the last update, quite a few things happened in my

Sándor Gyulai 40 May 23, 2020
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.

CreditCardForm CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card. Fixed typo use CreditCa

Orazz 1.4k Dec 15, 2022
A modern In-App Purchases management framework for iOS.

MerchantKit A modern In-App Purchases management framework for iOS developers. MerchantKit dramatically simplifies the work indie developers have to d

Benjamin Mayo 1.1k Dec 17, 2022
Make and accept payments in your iOS app via Venmo

Venmo iOS SDK The Venmo iOS SDK lets you make and accept payments in your app using Venmo. Installation If you're using CocoaPods: If you don't have a

Venmo 170 Dec 26, 2022
Accept credit cards and PayPal in your iOS app

Important: PayPal Mobile SDKs are Deprecated. The APIs powering them will remain operational long enough for merchants to migrate, but the SDKs themse

PayPal 973 Dec 18, 2022