RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.27k stars 303 forks source link

Weird state of checkTrialOrIntroDiscountEligibility #3862

Closed Pattio closed 3 months ago

Pattio commented 3 months ago

There's an interesting issue regarding checkTrialOrIntroDiscountEligibility:

It doesn't seem to work as it consistently returns unknown This issue was previously reported, and the solution provided was to use StoreKit 2. However, a later ticket suggests using StoreKit 1 instead. Additionally, if we use useStoreKit2IfAvailable, we receive a warning that it's deprecated and that we shouldn't set a value on it.

This leads to a confusing cycle:

In the end, I'm left confused. In my experience, StoreKit 1 doesn't work, and while StoreKit 2 seems to function, other warnings suggest that we shouldn't use it.


  1. Environment
    1. Platform: macOS
    2. SDK version: 4.41.0
    3. StoreKit version:
      • [x] StoreKit 1
      • [x] StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
    4. OS version: 14.4.1 (23E224)
    5. Xcode version: 15.3.0
    6. Device and/or simulator:
      • [x] Device
      • [ ] Simulator
    7. Environment:
      • [] Sandbox
      • [ ] TestFight
      • [ ] Production
    8. How widespread is the issue. Percentage of devices affected.
RCGitBot commented 3 months ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

Pattio commented 3 months ago

The reason why I think it's pretty major is the fact that afaik without checkTrialOrIntroDiscountEligibility you can't really properly offer trials and intro discounts which is one of the bigger selling points when using RevenueCat

WesleyClarkRC commented 3 months ago

Hi! We would recommend utilizing StoreKit2 with useStoreKit2IfAvailable. The call is deprecated, but not in functionality and it will continue to work. We are working towards a new call site for it. Can you share the debug logs for this when you are getting this unknown response?

Pattio commented 3 months ago

Hey, Wesley, thanks for the response!

We would recommend utilizing StoreKit2 with useStoreKit2IfAvailable.

Is this an official recommendation? I couldn't find any documentation or anything on your site that would suggest this.

I had thought of using useStoreKit2IfAvailable but then I was hesitant, because:

  1. I saw quite a few issues on the iOS repo with the RevenueCat team suggesting staying with SK1 as it's more stable/safe, for example this
  2. Going off the default path (since SK1 is the default when you init SDK) seems more dangerous

Can you share the debug logs for this when you are getting this unknown response?

Yes. I found the error which is:

WARN: 🍎‼️ App running on sandbox without a receipt file. Unable to determine intro eligibility unless you've purchased before and there is a receipt available.

I still haven't uploaded my app to the Mac App Store, so if this error will go away for people who download the app from App Store (as noted here) then I'm fine keeping SK1

Pattio commented 3 months ago

I'm closing this since it seem to work fine when the app is downloaded from the App Store

github-actions[bot] commented 3 months ago

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.