Skip to content

Commit

Permalink
fix setting iOS subscription type for one-time subscriptions (#2180)
Browse files Browse the repository at this point in the history
* fix setting iOS subscription type for one-time subscriptions

* fix lint

Co-authored-by: Andres Aguilar <andres.aguilar@nfl.com>
  • Loading branch information
andresesfm and Andres Aguilar authored Jan 3, 2023
1 parent 8597fef commit f87c0a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ios/RNIapIos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,10 @@ class RNIapIos: RCTEventEmitter, SKRequestDelegate, SKPaymentTransactionObserver
}

periodNumberIOS = String(format: "%lu", numOfUnits)
if numOfUnits != 0 {

if product.subscriptionPeriod != nil {
itemType = "subs"
}
// More reliable way of determining a subs on newer iOS versions
if #available(iOS 12.0, tvOS 12.0, *) {
if product.subscriptionGroupIdentifier != nil {
itemType = "subs"
}
}

// subscriptionPeriod = product.subscriptionPeriod ? [product.subscriptionPeriod stringValue] : @"";
// introductoryPrice = product.introductoryPrice != nil ? [NSString stringWithFormat:@"%@", product.introductoryPrice] : @"";
Expand Down

0 comments on commit f87c0a0

Please sign in to comment.