Giter Site home page Giter Site logo

swifttipjar's Introduction

SwiftTipJar

On Apple patforms, tip jars are a concept of letting users make in-app purchases to show appreciation for the app/developer, which don't actually unlock any additional features of the app.

This package lets you have a tip jar running in minutes.

Here are SwiftUI sample code and UIKit sample code that demonstrate this.

All you need to do is polish your UI and configure Consumable IAPs in App Store Connect or an Xcode StoreKit Configuration
(see Setting up StoreKit testing in Xcode).

Installation

SwiftTipJar is available through Swift Package Manager.

  • In Xcode, click File > Add Packages...
  • Select GitHub under Source Control Accounts
  • Search for SwiftTipJar
  • Click "Add Package" in bottom right

Usage

For a quick start refer to SwiftUI sample code and UIKit sample code.

Backstory

There are many - good - tutorials for implementing IAPs in Swift.

Following any of them will help you understand how StoreKit works, what are products request and products response, what makes up StoreKit products, how to initiate a purchase, how to observe the transaction queue, how to process a transaction...

I had to re-learn all that when I recently developed a tip jar for Tubist, a macOS menu bar YouTube player even though I've dealt with IAPs like less than two years ago. Memory fades!

Then it hit me - pretty much all tip jars work the same way, right? While learning how StoreKit works is useful and ahem noble, if all you need is a working tip jar, why not reach for a single package that already does all the lifting?

Thus I created SwiftTipJar. Use it, and hopefully get some tips out of it!

P.S. If you find any code smells or documentation smells, feel free to open an issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.