Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move TODOs into GitHub #778

Merged
merged 4 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions PublicSDKAPITester/RCPurchasesAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ @implementation RCPurchasesAPI
BOOL isAnonymous;

+ (void)checkAPI {
// TODO: Addresses these blocks
// typedef void (^RCReceivePurchaserInfoBlock)(RCPurchaserInfo * _Nullable, NSError * _Nullable) NS_SWIFT_NAME(Purchases.ReceivePurchaserInfoBlock);
// typedef void (^RCReceiveIntroEligibilityBlock)(NSDictionary<NSString *, RCIntroEligibility *> *) NS_SWIFT_NAME(Purchases.ReceiveIntroEligibilityBlock);
// typedef void (^RCReceiveOfferingsBlock)(RCOfferings * _Nullable, NSError * _Nullable) NS_SWIFT_NAME(Purchases.ReceiveOfferingsBlock);
// typedef void (^RCReceiveProductsBlock)(NSArray<SKProduct *> *) NS_SWIFT_NAME(Purchases.ReceiveProductsBlock);
// typedef void (^RCPurchaseCompletedBlock)(SKPaymentTransaction * _Nullable, RCPurchaserInfo * _Nullable, NSError * _Nullable, BOOL userCancelled) NS_SWIFT_NAME(Purchases.PurchaseCompletedBlock);
// typedef void (^RCDeferredPromotionalPurchaseBlock)(RCPurchaseCompletedBlock);
// typedef void (^RCPaymentDiscountBlock)(SKPaymentDiscount * _Nullable, NSError * _Nullable) NS_SWIFT_NAME(Purchases.PaymentDiscountBlock);

// TODO: iOS ONLY, TEST FOR THIS API BY LOOKING UP SELECTOR
// [p presentCodeRedemptionSheet];
RCPurchases *p = [RCPurchases configureWithAPIKey:@""];
Expand Down
2 changes: 0 additions & 2 deletions PurchasesCoreSwift/Attribution/AttributionPoster.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class AttributionPoster {
deviceCache.latestNetworkAndAdvertisingIdsSent(appUserID: currentAppUserID)
let latestSentToNetwork = latestNetworkIdsAndAdvertisingIdsSentByNetwork[networkKey]

// TODO: `(null)` is true to the ObjC code here, maybe we should reject this and not post?
// Post-migration: early return here.
let newValueForNetwork = "\(maybeIdentifierForAdvertisers ?? "(null)")_\(networkUserId ?? "(null)")"
guard latestSentToNetwork != newValueForNetwork else {
Logger.debug(Strings.attribution.skip_same_attributes)
Expand Down
2 changes: 0 additions & 2 deletions PurchasesCoreSwift/Networking/Backend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ private extension Backend {
func getOfferingsCallbacksAndClearCache(forKey key: String) -> [OfferingsResponseHandler] {
return callbackQueue.sync { [self] in
let callbacks = offeringsCallbacksCache.removeValue(forKey: key)
// TODO: Should we throw instead of NSParameterAssert?
assert(callbacks != nil)
return callbacks ?? []
}
Expand All @@ -645,7 +644,6 @@ private extension Backend {
func getPurchaserInfoCallbacksAndClearCache(forKey key: String) -> [BackendPurchaserInfoResponseHandler] {
return callbackQueue.sync { [self] in
let callbacks = purchaserInfoCallbacksCache.removeValue(forKey: key)
// TODO: Should we throw instead of NSParameterAssert?
assert(callbacks != nil)
return callbacks ?? []
}
Expand Down
2 changes: 0 additions & 2 deletions PurchasesCoreSwift/Public/EntitlementInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ import Foundation
dateFormatter: .iso8601SecondsDateFormatter)
}

// TODO(cleanup): Codable
init(entitlementId: String,
entitlementData: [String: Any],
productData: [String: Any],
Expand Down Expand Up @@ -285,7 +284,6 @@ private extension EntitlementInfo {

class func parseOwnershipType(ownershipType: String?) -> PurchaseOwnershipType {
guard let ownershipType = ownershipType else {
// TODO: should this be a warning?
return .purchased
}

Expand Down
1 change: 0 additions & 1 deletion PurchasesCoreSwift/Public/Offering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ import Foundation
self.serverDescription = serverDescription
self.availablePackages = availablePackages

// TODO: add validation to ensure we don't get multiple packages with the same type
for package in availablePackages {
switch package.packageType {
case .lifetime:
Expand Down
12 changes: 4 additions & 8 deletions PurchasesCoreSwift/Public/PurchaserInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ import Foundation
"""
}

// TODO after migration make this internal
@objc public let schemaVersion: String?
let schemaVersion: String?

// TODO after migration make this internal
@objc public convenience init?(data: [String: Any]) {
convenience init?(data: [String: Any]) {
self.init(data: data, dateFormatter: .iso8601SecondsDateFormatter, transactionsFactory: TransactionsFactory())
}

Expand Down Expand Up @@ -189,11 +187,9 @@ import Foundation
self.allPurchases = subscriberData.allPurchases
}

// TODO after migration make this internal
@objc public static let currentSchemaVersion = "2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed a couple of properties in my initial cleanup

static let currentSchemaVersion = "2"

// TODO after migration make this internal and remove objc rename
@objc(JSONObject) public func jsonObject() -> [String: Any] {
func jsonObject() -> [String: Any] {
return originalData.merging(
["schema_version": PurchaserInfo.currentSchemaVersion],
strategy: .keepOriginalValue
Expand Down
1 change: 0 additions & 1 deletion PurchasesCoreSwift/Purchasing/ProductsRequestFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import Foundation
import StoreKit

// todo: make internal
class ProductsRequestFactory {

func request(productIdentifiers: Set<String>) -> SKProductsRequest {
Expand Down
5 changes: 0 additions & 5 deletions PurchasesCoreSwift/Purchasing/PurchasesOrchestrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ class PurchasesOrchestrator {
receiptData: receiptData,
appUserID: self.appUserID) { maybeSignature, maybeKeyIdentifier, maybeNonce, maybeTimestamp, maybeError in
if let error = maybeError {
// TODO: Consider making a custom error. issues/751
// https://github.com/RevenueCat/purchases-ios/issues/751
completion(nil, error)
return
}
Expand All @@ -141,8 +139,6 @@ class PurchasesOrchestrator {
let nonce = maybeNonce,
let signature = maybeSignature,
let timestamp = maybeTimestamp else {
// TODO: Consider making a custom error.
// https://github.com/RevenueCat/purchases-ios/issues/751
completion(nil, ErrorUtils.unexpectedBackendResponseError())
return
}
Expand Down Expand Up @@ -225,7 +221,6 @@ extension PurchasesOrchestrator: StoreKitWrapperDelegate {

func storeKitWrapper(_ storeKitWrapper: StoreKitWrapper,
removedTransaction transaction: SKPaymentTransaction) {
// todo: remove
// unused for now
}

Expand Down
2 changes: 1 addition & 1 deletion PurchasesCoreSwift/Purchasing/StoreKitWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class StoreKitWrapper: NSObject, SKPaymentTransactionObserver {

func payment(withProduct product: SKProduct) -> SKMutablePayment {
let payment = SKMutablePayment(product: product)
// todo: check that it's fine to omit tvOS and iOS since the relevant methods exist in targets lower than ours

if #available(macOS 10.14, watchOS 6.2, macCatalyst 13.0, *) {
payment.simulatesAskToBuyInSandbox = Self.simulatesAskToBuyInSandbox
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Nimble
import StoreKit
@testable import PurchasesCoreSwift

// TODO (post-migration): Move this test case to the new framework target (PurchasesCoreSwift).
class OfferingsManagerTests: XCTestCase {

let mockDeviceCache = MockDeviceCache()
Expand Down