mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
[REVIEW] 2.0.0 (#80)
* first cleanup pass * More cleanup and removal of delegate methods. * Framework compiling. * completion -> completionBlock * Tests compiling. * Tests running. * Update restore tests. * Make restore block based. * fix restore failure case. * Tests passing for non-purchase methods. * Change purchase method to a block. * Lol its done. * Failing test for multiple calls to callback. * Only call calback once. * Add tests to ensure only called for the same product. * Addd test case for calling purchase twice. * Issue an error if a purchase is attempted for the same product twice. * Update originalApplicationVersion tests. * Update delegate tests. * Set delegate on launch. * Handle fetching latest purchaser info. * Remove uneeded calls. * Cleanup. * Changes based on test integration. * Add tests for idempotency * Refactor callbacks cache. * Add caching for subscriber GET. * Cache calls getEntitlements * Add an isEqual implementation to RCPurchaserInfo * RCPurchaserInfo -> PurchaserInfo in Swift * Basic is equal case. * If active entitlements changes, not equal. * Add failing test case. * Fix duplicate makePurchase calls. * Create a macro for dispatching. * Move cache checking out of updateCaches. * Fix race condition. * Caches last updated doesn't apply to entitlements. * Refactor caching methods. * Add more macros. * Also clear entitlements cache. * More intelligently handle cache in the getters. * Get rid of updatePurchaserInfo. * Simulate deferred called. * Calls delegate on initialization. * Review feedback/ * Call delegate when random transactions fire. * Only send new purchaser info when something changes. * Make other delegate calls on change only. * Expect fewer delegate calls. * Eliminates the need for use_frameworks\! * Make it more swifty. * Make more swifty and add price localization. * Smarter cache handling. * Improved purchaser info logging. * Fix RCPurchaserInfo description * Make products fetching idempotent. * Rename delegate method for updated purchaser info * Rename products method. * Start adding logs. * Log all the things. * Fix tests * Logging for identify and alias. * Update version numbers and copyright. * Accept subscription_group_id on post receipt * Send subscription group identifier. * Add test for posting subscription group. * Add failing test for getting missing products. * Fetch products if missing. * Cache produts on makePurchase. * Call delegate even if there is a completion block. * Log when we set two singletons. * Setup reset callback. * Add callback to reset. * Start cleanup and fix bug. * Reorganize methods. * updated some comments in RCPurchases.h * Add failing tests for identity methods calling delegate. * Call delegate when calling reset, identify, etc. * didReceiveUpdated * Rename delegate method. * Update README * README update added swift and Obj-C labels * added sample app and updated readme * removed shared instance setter * fixed obj-c tag in code sample * update call delegate when set * Added OS_ACTIVITY_MODE callout * Updated code snippets * make both delegates optional * Version 2.0.0-rc1 * Update 2.0.0 instructions Updated install instructions for 2.0.0-rc * Adds more installation instructions * Added v2.0 doc links * adds missing documentation * Makes sure we don't create alias or identify over the same app user id * Some small review stuff. * Fix compile issue. * updated README
This commit is contained in:
1 parent
b4e9395403
commit
c52278fbcf
56 files changed
+2811
-860
No files matched your search
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// InitialViewController.swift
|
||||
// SwiftExample
|
||||
//
|
||||
// Created by Ryan Kotzebue on 1/9/19.
|
||||
// Copyright © 2019 RevenueCat. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import Purchases
|
||||
|
||||
class InitialViewController: UIViewController {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
// Get the latest purchaserInfo to see if we have a pro cat user or not
|
||||
Purchases.shared.purchaserInfo { (purchaserInfo, error) in
|
||||
if let e = error {
|
||||
print(e.localizedDescription)
|
||||
}
|
||||
if let purchaserInfo = purchaserInfo {
|
||||
|
||||
// Route the view depending if we have a premium cat user or not
|
||||
let storyboard = UIStoryboard(name: "Main", bundle: nil)
|
||||
var controller : UIViewController!
|
||||
|
||||
|
||||
if purchaserInfo.activeEntitlements.contains("pro_cat") {
|
||||
|
||||
// if we have a pro_cat subscriber, send them to the cat screen
|
||||
controller = storyboard.instantiateViewController(withIdentifier: "cats")
|
||||
|
||||
} else {
|
||||
|
||||
// if we don't have a pro subscriber, send them to the upsell screen
|
||||
controller = storyboard.instantiateViewController(withIdentifier: "upsell")
|
||||
}
|
||||
|
||||
|
||||
let nav = UINavigationController(rootViewController: controller)
|
||||
nav.navigationBar.isHidden = true
|
||||
self.present(nav, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user