NewsBlur/clients/ios/Classes/PremiumManager.h
David Sinclair 7c33270c5b iOS: premium manager
Purchases could fail if they require approval, and complete after leaving the premium view, or on next app launch. So I’ve split the premium business logic into a separate manager that maintains a permanent transaction observer.
2018-10-04 17:00:22 -07:00

26 lines
551 B
Objective-C

//
// PremiumManager.h
// NewsBlur
//
// Created by David Sinclair on 2018-10-04.
// Copyright © 2018 NewsBlur. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
#import "NewsBlurAppDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface PremiumManager : NSObject
@property (nonatomic, strong) NSArray<SKProduct *> *products;
@property (nonatomic, strong) NSArray<NSArray<NSString *> *> *reasons;
- (void)loadProducts;
- (void)purchase:(SKProduct *)product;
- (void)restorePurchase;
@end
NS_ASSUME_NONNULL_END