All Projects → MosheBerman → Patronkit

MosheBerman / Patronkit

Licence: mit
A framework to add patronage to your apps.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Patronkit

Cloudkitgdpr
Framework for allowing users to manage data stored in iCloud
Stars: ✭ 126 (-65.95%)
Mutual labels:  cloudkit, xcode
Todolist
A simple ToDoList written in Swift
Stars: ✭ 100 (-72.97%)
Mutual labels:  cloudkit, xcode
Tips
Most commonly used git tips and tricks.
Stars: ✭ 20,044 (+5317.3%)
Mutual labels:  tips
Solarized Dark For Xcode
Solarized Dark Theme for Xcode. Compatible with all modern versions of Xcode since 2013!
Stars: ✭ 358 (-3.24%)
Mutual labels:  xcode
Swift Staticlibs
Scripts to allow Swift static libraries to be compiled in Xcode
Stars: ✭ 339 (-8.38%)
Mutual labels:  xcode
Awesome Cheatsheets
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Stars: ✭ 26,007 (+6928.92%)
Mutual labels:  xcode
Ios Open Gpx Tracker
GPS Tracker app for iOS + WatchOS. Log your tracks without limits and share them; Open source GPX tracker app written in Swift
Stars: ✭ 344 (-7.03%)
Mutual labels:  xcode
Tctip
Stars: ✭ 324 (-12.43%)
Mutual labels:  tips
Tulsi
An Xcode Project Generator For Bazel
Stars: ✭ 365 (-1.35%)
Mutual labels:  xcode
Lsunusedresources
A Mac App to find unused images and resources in XCode project.
Stars: ✭ 3,692 (+897.84%)
Mutual labels:  xcode
Ci helloworld
A simple example of how to setup a complete CI environment for C and C++
Stars: ✭ 357 (-3.51%)
Mutual labels:  xcode
Themer Gui
A graphical UI for themer. Replaced by Progressive Web App at https://themer.dev.
Stars: ✭ 337 (-8.92%)
Mutual labels:  xcode
Mockolo
Efficient Mock Generator for Swift
Stars: ✭ 327 (-11.62%)
Mutual labels:  xcode
Easyswiftlayout
Lightweight Swift framework for Apple's Auto-Layout
Stars: ✭ 345 (-6.76%)
Mutual labels:  xcode
Snapkit
A Swift Autolayout DSL for iOS & OS X
Stars: ✭ 18,091 (+4789.46%)
Mutual labels:  xcode
Xcode Wakatime
Xcode plugin for automatic time tracking and metrics generated from your programming activity.
Stars: ✭ 360 (-2.7%)
Mutual labels:  xcode
Awesome Nonsan
🔫 논산 육군훈련소에 대한 정보와 팁
Stars: ✭ 324 (-12.43%)
Mutual labels:  tips
Swift5 Module Template
An opinionated starting point for awesome, reusable Swift 5 modules
Stars: ✭ 331 (-10.54%)
Mutual labels:  xcode
Touchbar
Apple MacBook Pro TouchBar (NSTouchBar) Cheatsheet and Swift examples
Stars: ✭ 339 (-8.38%)
Mutual labels:  xcode
Cargo Mobile
Rust on mobile made easy!
Stars: ✭ 362 (-2.16%)
Mutual labels:  xcode

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].