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

Fix/fetch product concurrency #495

Merged
merged 9 commits into from
Aug 15, 2020

Conversation

cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Sep 30, 2019

This PR Fixes #344 (outside of the main thread) and fixes #468.

@cipolleschi cipolleschi changed the base branch from master to develop September 30, 2019 11:41
@cipolleschi
Copy link
Contributor Author

updated.

@cipolleschi
Copy link
Contributor Author

I have some trouble making the test work with the CI.
Locally, they work perfectly: the execution is paused, waiting for the thread to signal the completion of the chunk of work and verify the expectation afterward.
Anyway, once executed by Travis, it looks like that the execution is not paused, and so the test fails.

Do you know how to fix this?

@Sam-Spencer Sam-Spencer added area: purchase flows purchase processes, efficiency and failures status: needs analysis community analysis is needed type: enhancement labels Feb 24, 2020
@@ -44,18 +44,29 @@ class ProductsInfoController: NSObject {
}

let inAppProductRequestBuilder: InAppProductRequestBuilder

private var spinLock: OSSpinLock
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm under the impression that OSSpinLock is deprecated in favor of os_unfair_lock. Is there a reason you use this here but not in tests and vice versa?

@Sam-Spencer Sam-Spencer added the stale extensive inactivity; will reopen for new activity label May 29, 2020
@Sam-Spencer Sam-Spencer reopened this Aug 15, 2020
@Sam-Spencer Sam-Spencer merged commit 40cca01 into bizz84:develop Aug 15, 2020
@RamyaThirunavukkarasu
Copy link

RamyaThirunavukkarasu commented Dec 13, 2021

I am getting crashes while fetching the promotional code discount price details (localizedPrice and priceLocale.currencyCode) in iOS 12.5 and 13.5 but iOS 14 is working fine .

Price is coming fine but while trying to fetch localizedPrice or priceLocale.currencyCode app getting crash

I am using the latest version of SwiftyStoreKit(0.16.4)

My Xcode version is 13.1

static func getProductOfferDetails(_ productDiscount: SKProductDiscount?) -> InAppProductDiscount? {
guard let productDiscount = productDiscount else { return nil }

    var inAppProductDiscunt = InAppProductDiscount()
    inAppProductDiscunt.price = productDiscount.localizedPrice ?? String()
    inAppProductDiscunt.currency_code = productDiscount.priceLocale.currencyCode
    inAppProductDiscunt.numberOfPeriods = productDiscount.numberOfPeriods
    inAppProductDiscunt.numberOfUnits = productDiscount.subscriptionPeriod.numberOfUnits
    inAppProductDiscunt.localizedSubscriptionPeriod = productDiscount.localizedSubscriptionPeriod
    inAppProductDiscunt.unit = InAppProduct.getSubscriptionPeriodUnit(productDiscount.subscriptionPeriod.unit.rawValue)
    inAppProductDiscunt.paymentMode = inAppProductDiscunt.getPaymentMode(productDiscount.paymentMode.rawValue)
    if #available(iOS 12.2, *) {
        inAppProductDiscunt.type = inAppProductDiscunt.getType(productDiscount.type.rawValue)
        inAppProductDiscunt.identifier = productDiscount.identifier
    }
    return inAppProductDiscunt
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: purchase flows purchase processes, efficiency and failures stale extensive inactivity; will reopen for new activity status: needs analysis community analysis is needed type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants