-
Notifications
You must be signed in to change notification settings - Fork 316
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
Bug: CheckTrialOrIntroDiscountEligibility too slow #1893
Comments
👀 SDKONCALL-120 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Thanks for reporting! Currently we use StoreKit 2 for this particular API regardless of whether Could you share the debug logs for your device? |
… explicitly enabled Temporary change to debug #1893.
@jesus-mg-ios would you mind trying out the branch It just disables SK2 for this particular operation. Let me know if you need any instructions for using the SDK from that branch |
Thanks, I'm gonna try it! |
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further! |
Hi @aboedo, the change was amazingly faster. We're gonna share with you the logs before and |
@jesus-mg-ios thanks for getting back to us. This confirms that the issue is StoreKit 2's underlying API being very slow for this... Which is frankly unfortunate because it's the only one that's technically guaranteed to be perfectly accurate (with StoreKit 1, 100% accuracy for intro eligibility is technically not possible 🤕). It will still be correct for the vast majority of use cases, though. We're going to think about the best way to provide flexibility for this API. cc @NachoSoto |
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further! |
We are also experiencing this issue, might it be possible to request and cache the eligibility properties together with the offerings on app start? From my understanding the values should not change except if a product is purchased at which point RevenueCat should know about it and could invalidate the cache. I may be missing something here though. |
@timfraedrich I just came here because of the same issue - being able to cache offerings and eligibility would be great. Afaics this would require making |
Caching eligibility totally makes sense. But this approach wouldn't be trivial / possible. |
And it is possible to use a configuration parameter to disable (opt), the case that @aboedo reverted? I think that solve our problem for now. @NachoSoto . At this moment we have not require a 100% of accuracy in this. |
@NachoSoto afaics one can encode at least an SK2Product using I think in general though, being able to cache as much as possible of the pricing would be highly desirable. In our app, for example, we just added a lock screen widget that on the free version just sends a user to a paywall. That could very well happen from a cold start, and it would be great if we could display prices instantly. |
Hey folks, thanks for the feedback! In the meantime, we're also discussing the possibility of reusing the |
… enabled This used to always default to the SK2 implementation if it was available because it was much more reliable. However, as we've learned (#1893), it can be significantly slow. Until we implement caching for it ([CSDK-493]), this for now allows users to disable it if it's too slow. For users that don't specify `useSk2IfAvailable`, SK2 is now the new default, so this class will continue to use the "better" implementation for them too.
… enabled (#1984) This is similar to #1894, but as a permanent change. This used to always default to the SK2 implementation if it was available because it was much more reliable. However, as we've learned (#1893), it can be significantly slow. Until we implement caching for it ([CSDK-493]), this for now allows users to disable it if it's too slow. For users that don't specify `useSk2IfAvailable`, SK2 is now the new default, so this class will continue to use the "better" implementation for them too. [CSDK-493]: https://revenuecats.atlassian.net/browse/CSDK-493?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further! |
Update here: we've updated |
I also filed CSDK-493 to add a caching mechanism to |
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further! |
…ons` This changes the default back to `StoreKit 1`. We decided to do this for the following reasons: - Purchasing with `PromotionalOffer`s does not work with StoreKit 2 due to an Apple bug (see #2020 (comment)) - `checkTrialOrIntroDiscountEligibility` is significantly slower with StoreKit 2 (#1893). We're adding optimizations to help with that (#2007), but the underlying logic will still be slow. - A rare race-condition where `StoreKit 2` does not have transactions after a purchase ([TRIAGE-82]). We have some workarounds (#1945), but it's still being investigated. _ Note: This effectively reverts 0ee540a. That commit made it easier to only change the default in one place which is why this PR is basically just one line._
…ons` (#2022) This changes the default back to `StoreKit 1`. We decided to do this for the following reasons: - Purchasing with `PromotionalOffer`s does not work with StoreKit 2 due to an Apple bug (see #2020 (comment)) - `checkTrialOrIntroDiscountEligibility` is significantly slower with `StoreKit 2` (#1893). We're adding optimizations to help with that (#2007), but the underlying logic will still be slow. - A rare race-condition where `StoreKit 2` does not have transactions after a purchase ([TRIAGE-82]). We have some workarounds (#1945), but it's still being investigated. _Note: This effectively reverts 0ee540a. That commit made it easier to only change the default in one place which is why this PR is basically just one line._ [TRIAGE-82]: https://revenuecats.atlassian.net/browse/TRIAGE-82?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Final update here: the implementation of |
This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports. |
Describe the bug
Add any other context about the problem here.
We are using checkTrialOrIntroDiscountEligibility in iOS with swift after get the product, and we notice that this call is too slow (even 45s - 1 min).
useStoreKit2IfEnabled
) (Y/N): NAdditional context
Environment: Real device & simulator. iOS 15.5
SDK Version: "4.10.0"
Code that is too slow
The text was updated successfully, but these errors were encountered: