In App Purchase Manager framework for iOS

Overview

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 life, but now I am back again and started with a nice update for Swift 4.2 compatibility. More to come, stay tuned!

ToDo for 1.0
  • ☐ Documentation!! Work in progress
  • ☐ Change productPurchased(productIdentifier: String) -> Bool to return Tuple with 2 bools to replace hasValidReceipt property
  • ☑︎ Change NSURLConnection to NSURLSession

Installation

CocoaPods

pod 'InAppFw'

Usage

First you should add product IDs:

InAppFw.sharedInstance.addProductId(String)
InAppFw.sharedInstance.addProductIds([String])

Then you can request them from the Apple servers:

InAppFw.sharedInstance.requestProducts(completionHandler: (success: Bool, products: [SKProduct]?)

Make purchases:

InAppFw.sharedInstance.purchaseProduct(SKProduct)

Restore purchases:

InAppFw.sharedInstance.restoreCompletedTransactions()

Register for notifications:

- kIAPPurchasedNotification
- kIAPFailedNotification

Load the previously purchased products:

InAppFw.sharedInstance.loadPurchasedProducts(checkWithApple: Bool, completion: ((valid: Bool) -> Void)?)

checkWithApple: if true, will validate the Purchase receipt with Apple Servers too. The completion will be only true if the receipt is valid.

You might also like...
Make and accept payments in your iOS app via Venmo
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

Accept credit cards and PayPal in your iOS app
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

A lightweight iOS library for In-App Purchases

#RMStore A lightweight iOS library for In-App Purchases. RMStore adds blocks and notifications to StoreKit, plus receipt verification, content downloa

Square In-App Payments iOS SDK SwiftUI

Square In-App Payments iOS SDK SwiftUI Build remarkable payments experiences in

SwiftUI BusinessCard - Created iOS Business card app to practice SwiftUI
SwiftUI BusinessCard - Created iOS Business card app to practice SwiftUI

SwiftUI_BusinessCard Created iOS Business card app to practice SwiftUI

Handle in-app purchases in iOS in a convenient way

InAppPurchases Handle in-app purchases in iOS in a convenient way. Overview InAppPurchases covers all the basic aspects of in-app purchases in swift i

With SwiftUI payment share app
With SwiftUI payment share app

Splitpayment With SwiftUI payment share app.

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 for saving notes

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

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.

Comments
  • Security of purchased products and question about checkWithApple

    Security of purchased products and question about checkWithApple

    Hi! This is an awesome manager for In-App purchase; I only have two questions. If I understood, purchased products are stored with bool - key in UserDefaults: isn't this policy potentially unsafe? It's very simple to access to UserDefaults... The second question is about checkWithApple in: InAppFw.sharedInstance.loadPurchasedProducts(checkWithApple: Bool, completion: ((valid: Bool) -> Void)?) Will the check prompt user to insert password, or is it independent? Thanks

    opened by francesc-o 2
  • Swift 3

    Swift 3

    Im getting some issues after updating my project to swift3.

    Error 1: Ambiguous reference to member 'dataTask(with:completionHandler:)'

    let task = URLSession.shared.dataTask(with: storeRequest, completionHandler: { (data, response, error) -> Void in

    Error 2: 'jsonObject' produces 'Any', not the expected contextual result type 'AnyObject?' if let data = data, let jsonResponse: AnyObject = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions()) {

    Error 3: Use of unresolved identifier 'SKErrorPaymentCancelled' if (transaction.error!.code != SKErrorPaymentCancelled) {

    Any chance for some help?

    opened by tobbe01 1
  • Correct the spelling of CocoaPods in README

    Correct the spelling of CocoaPods in README

    This pull requests corrects the spelling of CocoaPods 🤓 https://github.com/CocoaPods/shared_resources/tree/master/media

    Created with cocoapods-readme.

    opened by ReadmeCritic 0
Releases(0.9.6)
Owner
Sándor Gyulai
Sándor Gyulai
A jailed in-app purchase cracker for iOS 12.2-15.6

Satella Jailed For, um, educational purposes only or something. Definitely don't use this to pirate in-app purchases in apps to which you don't have l

Lilly 314 Dec 31, 2022
TPInAppReceipt is a lightweight, pure-Swift library for reading and validating Apple In App Purchase Receipt locally.

TPInAppReceipt is a lightweight, pure-Swift library for reading and validating Apple In App Purchase Receipt locally. Features Read all

Pavel T 520 Jan 4, 2023
Ruby Gem for Rails - Easy iTunes In-App Purchase Receipt validation, including auto-renewable subscriptions

Monza is a ruby gem that makes In-App Purchase receipt and Auto-Renewable subscription validation easy. You should always validate receipts on the ser

Gabriel 159 Jan 7, 2023
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
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
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
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 framework to add patronage to your apps.

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. I

Moshe 365 Nov 20, 2022
Easily integrate Credit Card payments module in iOS App. Swift 4.0

MFCard Buy me a coffee MFCard is an awesome looking Credit Card input & validation control. Written in Swift 3. YOoo, Now MFCard is on Swift 5. Swift

MobileFirst 362 Nov 29, 2022
In-app purchases and subscriptions made easy. Support for iOS, iPadOS, watchOS, and Mac.

In-app purchases and subscriptions made easy. Support for iOS, iPadOS, watchOS, and Mac.

RevenueCat 1.6k Jan 6, 2023