Skip to content

Commit

Permalink
Migrates RCPurchases (#758)
Browse files Browse the repository at this point in the history
* Start of migration

* Migrates RCPurchases
Resolves #546 (last file to be migrated)

* Use Nimble's throwAssertion predicate

* Update for comments

* Start of migration

* Sorted project and files.

* Fix build target for IntroEligibilityCalculatorTests

* Remove debug print

* Add back `sharedPurchases`
  • Loading branch information
taquitos authored Aug 23, 2021
1 parent 5f91ef7 commit 444a979
Show file tree
Hide file tree
Showing 42 changed files with 1,648 additions and 1,705 deletions.
2 changes: 0 additions & 2 deletions PublicSDKAPITester/RCEntitlementInfoAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// Copyright © 2021 Purchases. All rights reserved.
//


@import Purchases;
@import PurchasesCoreSwift;

#import "RCEntitlementInfoAPI.h"
Expand Down
1 change: 0 additions & 1 deletion PublicSDKAPITester/RCEntitlementInfosAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2021 Purchases. All rights reserved.
//

@import Purchases;
@import PurchasesCoreSwift;

#import "RCEntitlementInfosAPI.h"
Expand Down
2 changes: 1 addition & 1 deletion PublicSDKAPITester/RCIntroEligibilityAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Purchases. All rights reserved.
//

@import Purchases;
@import PurchasesCoreSwift;
#import "RCIntroEligibilityAPI.h"

@implementation RCIntroEligibilityAPI
Expand Down
2 changes: 1 addition & 1 deletion PublicSDKAPITester/RCOfferingAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Purchases. All rights reserved.
//

@import Purchases;
@import PurchasesCoreSwift;
#import "RCOfferingAPI.h"

@implementation RCOfferingAPI
Expand Down
2 changes: 1 addition & 1 deletion PublicSDKAPITester/RCOfferingsAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Purchases. All rights reserved.
//

@import Purchases;
@import PurchasesCoreSwift;

#import "RCOfferingsAPI.h"

Expand Down
10 changes: 4 additions & 6 deletions PublicSDKAPITester/RCPurchasesAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by Joshua Liebowitz on 6/18/21.
//

@import Purchases;
@import PurchasesCoreSwift;
@import StoreKit;

Expand Down Expand Up @@ -43,6 +42,9 @@ + (void)checkAPI {
// TODO: iOS ONLY, TEST FOR THIS API BY LOOKING UP SELECTOR
// [p presentCodeRedemptionSheet];
RCPurchases *p = [RCPurchases configureWithAPIKey:@""];
[RCPurchases configureWithAPIKey:@"" appUserID:@""];
[RCPurchases configureWithAPIKey:@"" appUserID:@"" observerMode:false];
[RCPurchases configureWithAPIKey:@"" appUserID:@"" observerMode:false userDefaults:nil];

[RCPurchases setLogHandler:^(RCLogLevel l, NSString *i) {}];
canI = [RCPurchases canMakePayments];
Expand Down Expand Up @@ -70,10 +72,7 @@ + (void)checkAPI {
SKPaymentDiscount *skmd = [[SKPaymentDiscount alloc] init];

RCPackage *pack = [[RCPackage alloc] initWithIdentifier:@"" packageType:RCPackageTypeCustom product:skp offeringIdentifier:@""];
[RCPurchases configureWithAPIKey:@"" appUserID:@""];
[RCPurchases configureWithAPIKey:@"" appUserID:@"" observerMode:false];
[RCPurchases configureWithAPIKey:@"" appUserID:@"" observerMode:false userDefaults:nil];


[p invalidatePurchaserInfoCache];

NSDictionary<NSString *, NSString *> *attributes = nil;
Expand Down Expand Up @@ -103,7 +102,6 @@ + (void)checkAPI {
[p restoreTransactionsWithCompletionBlock:^(RCPurchaserInfo *i, NSError *e) {}];
[p syncPurchasesWithCompletionBlock:^(RCPurchaserInfo *i, NSError *e) {}];
[p checkTrialOrIntroductoryPriceEligibility:@[@""] completionBlock:^(NSDictionary<NSString *,RCIntroEligibility *> *d) { }];
[p checkTrialOrIntroductoryPriceEligibility:@[@""] completionBlock:^(NSDictionary<NSString *,RCIntroEligibility *> *r) { }];
[p paymentDiscountForProductDiscount:skpd product:skp completion:^(SKPaymentDiscount *d, NSError *e) { }];
[p purchaseProduct:skp withDiscount:skmd completionBlock:^(SKPaymentTransaction *t, RCPurchaserInfo *i, NSError *e, BOOL userCancelled) { }];
[p purchasePackage:pack withDiscount:skmd completionBlock:^(SKPaymentTransaction *t, RCPurchaserInfo *i, NSError *e, BOOL userCancelled) { }];
Expand Down
2 changes: 1 addition & 1 deletion PublicSDKAPITester/RCPurchasesErrorUtilsAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
//
// Created by César de la Vega on 7/21/21.

@import Purchases;
@import PurchasesCoreSwift;
@import StoreKit;

#import "RCPurchasesErrorUtilsAPI.h"

Expand Down
1 change: 0 additions & 1 deletion PublicSDKAPITester/RCTransactionAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2021 Purchases. All rights reserved.
//

@import Purchases;
@import PurchasesCoreSwift;

#import "RCTransactionAPI.h"
Expand Down
142 changes: 69 additions & 73 deletions Purchases.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

68 changes: 0 additions & 68 deletions Purchases/ProtectedExtensions/RCPurchases+Protected.h

This file was deleted.

2 changes: 0 additions & 2 deletions Purchases/Public/Purchases.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ FOUNDATION_EXPORT double PurchasesVersionNumber;
Purchases version string
*/
FOUNDATION_EXPORT const unsigned char PurchasesVersionString[];

#import "RCPurchases.h"
Loading

0 comments on commit 444a979

Please sign in to comment.