Skip to content

Instantly share code, notes, and snippets.

View ligate's full-sized avatar
💭
I may be slow to respond.

ligate

💭
I may be slow to respond.
  • Ibaks Studio
View GitHub Profile
@ligate
ligate / PKIAPHandler.swift
Created April 21, 2022 17:30 — forked from pramod-kumar-ios/PKIAPHandler.swift
A handler class that will help you to integrate the In App Purchase (IAP) in you iPhone, iPad, iPod application developed with Swift language.
//
// PKIAPHandler.swift
//
// Created by Pramod Kumar on 13/07/2017.
// Copyright © 2017 Pramod Kumar. All rights reserved.
//
import UIKit
import StoreKit
enum PKIAPHandlerAlertType {
@ligate
ligate / AppDelegate.swift
Created April 21, 2022 12:16 — forked from jcaracciolo/AppDelegate.swift
IOS In-App Purchases and Subscriptions
class AppDelegate: UIResponder, UIApplicationDelegate, SKPaymentTransactionObserver {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
SKPaymentQueue.default().add(self)
//...
return true
}
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
@ligate
ligate / MyStoreKitDelegate.swift
Created April 21, 2022 12:16 — forked from jcaracciolo/MyStoreKitDelegate.swift
IOS In-App Purchases and Subscriptions
import StoreKit
class MyStoreKitDelegate: NSObject {
let monthlySubID = "MyApp.sub.allaccess.monthly"
let yearlySubID = "MyApp.sub.allaccess.yearly"
var products: [String: SKProduct] = [:]
func fetchProducts() {
let productIDs = Set([monthlySubID, yearlySubID])