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

Check Intro Eligibility is Wrong in Sandbox (Not tested yet in Testflight) #4501

Open
8 of 12 tasks
jesus-mg-ios opened this issue Nov 20, 2024 · 6 comments
Open
8 of 12 tasks
Labels

Comments

@jesus-mg-ios
Copy link

jesus-mg-ios commented Nov 20, 2024

Describe the bug
We are encountering an issue with the checkTrialOrIntroDiscountEligibility(product:) method in RevenueCat. The method is consistently returning ineligible for a specific user, even though Apple's system indicates that the user is eligible for a free trial or introductory offer.

  1. Environment
    1. Platform: iOS
    2. SDK version: 5.9.0
    3. StoreKit version:
      • StoreKit 1 (default on versions <5.0.0. Can be enabled in versions >=5.0.0 with .with(storeKitVersion: .storeKit1))
      • StoreKit 2 (default on versions >=5.0.0)
    4. OS version: 18.1
    5. Xcode version: 16.1
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFlight
      • Production
    8. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
DEBUG: ℹ️ Configuring SDK using provided UserDefaults.
DEBUG: 👤 Identifying App User ID
DEBUG: ℹ️ Debug logging enabled
DEBUG: ℹ️ SDK Version - 5.9.0
DEBUG: ℹ️ Bundle ID - bundleId
DEBUG: ℹ️ System Version - Version 18.1 (Build 22B83)
DEBUG: ℹ️ Not using a simulator.
DEBUG: 👤 Initial App User ID set
DEBUG: ℹ️ Purchases is configured with response verification disabled
DEBUG: ℹ️ Purchases is configured with StoreKit version 2
DEBUG: ℹ️ Observing StoreKit.PurchaseIntent.intents
DEBUG: ℹ️ Delegate set
DEBUG: ℹ️ setting reserved attribute: $email
DEBUG: ℹ️ applicationWillEnterForeground
DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG: ℹ️ GetOfferingsOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId/offerings
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId/offerings'
DEBUG: ℹ️ setting reserved attribute: $email
WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
DEBUG: ℹ️ Vending CustomerInfo from cache.
WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
DEBUG: ℹ️ Vending CustomerInfo from cache.
DEBUG: ℹ️ No cached Offerings, fetching from network
WARN: ⚠️ The appUserID passed to logIn is the same as the one already cached. No action will be taken.
DEBUG: ℹ️ Vending CustomerInfo from cache.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ setting reserved attribute: $idfa
DEBUG: ℹ️ setting reserved attribute: $idfv
DEBUG: ℹ️ setting reserved attribute: $ip
DEBUG: ℹ️ setting reserved attribute: $deviceVersion
DEBUG: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId/offerings' (304)
DEBUG: ℹ️ No existing products cached, starting store products request for: ["first_1year", "second_1year"]
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["first_1year", "second_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["first_1year", "second_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ GetOfferingsOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId/offerings, 0 requests left in the queue
DEBUG: ℹ️ GetCustomerInfoOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId'
DEBUG: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId' (304)
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: ℹ️ GetCustomerInfoOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId, 0 requests left in the queue
DEBUG: ℹ️ GetCustomerInfoOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId'
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId' (304)
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: ℹ️ GetCustomerInfoOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId, 0 requests left in the queue
DEBUG: ℹ️ GetOfferingsOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId/offerings
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId/offerings'
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId/offerings' (304)
DEBUG: ℹ️ Found an existing request for products: ["first_1year", "second_1year"], appending to completion
DEBUG: ℹ️ GetOfferingsOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId/offerings, 0 requests left in the queue
DEBUG: ℹ️ GetCustomerInfoOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId'
DEBUG: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId' (304)
DEBUG: 😻 CustomerInfo updated from network.
WARN: ⚠️ Sync attributes and offerings rate limit reached:5 per 60 seconds. Returning offerings from cache.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: ℹ️ GetCustomerInfoOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId, 0 requests left in the queue
DEBUG: ℹ️ GetOfferingsOperation: Started
WARN: ⚠️ Sync attributes and offerings rate limit reached:5 per 60 seconds. Returning offerings from cache.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId/offerings
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId/offerings'
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId/offerings' (304)
DEBUG: ℹ️ Found an existing request for products: ["first_1year", "second_1year"], appending to completion
DEBUG: ℹ️ Found an existing request for products: ["second_1year", "first_1year"], appending to completion
DEBUG: ℹ️ GetOfferingsOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId/offerings, 0 requests left in the queue
DEBUG: ℹ️ GetCustomerInfoOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId'
DEBUG: ℹ️ Network operation 'GetCustomerInfoOperation' found with the same cache key 'GetCustomerInfo…'. Skipping request.
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId' (304)
DEBUG: 😻 CustomerInfo updated from network.
WARN: ⚠️ Sync attributes and offerings rate limit reached:5 per 60 seconds. Returning offerings from cache.
DEBUG: ℹ️ No cached Offerings, fetching from network
DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: ℹ️ GetCustomerInfoOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId, 0 requests left in the queue
DEBUG: ℹ️ GetOfferingsOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId/offerings
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId/offerings'
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId/offerings' (304)
DEBUG: ℹ️ Found an existing request for products: ["first_1year", "second_1year"], appending to completion
DEBUG: ℹ️ GetOfferingsOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId/offerings, 0 requests left in the queue
DEBUG: ℹ️ GetCustomerInfoOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/subscriberId
DEBUG: ℹ️ API request started: GET '/v1/subscribers/subscriberId'
DEBUG: 😻 Store products request received response
DEBUG: ℹ️ Store products request finished
DEBUG: ℹ️ API request completed: GET '/v1/subscribers/subscriberId' (304)
DEBUG: 😻 CustomerInfo updated from network.
DEBUG: ℹ️ GetCustomerInfoOperation: Finished
DEBUG: ℹ️ Serial request done: GET /v1/subscribers/subscriberId, 0 requests left in the queue
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
DEBUG: 😻 Offerings updated from network.
WARN: ⚠️ Sync attributes and offerings rate limit reached:5 per 60 seconds. Returning offerings from cache.
DEBUG: ℹ️ Vending Offerings from memory cache
DEBUG: ℹ️ Vending Offerings from memory cache
DEBUG: ℹ️ No existing products cached, starting store products request for: ["second_1year"]
DEBUG: 😻 Store products request received response
DEBUG: ℹ️ Store products request finished
DEBUG: ℹ️ Caching trial or intro eligibility for products: ["second_1year"]
  1. Steps to reproduce, with a description of expected vs. actual behavior

A sandbox user that time ago, reset eligibility through apple settings, with a fresh reinstall .checkTrialOrIntroDiscountEligibility(product: product) returns inelegible. Apple Sheet shows trial.

  1. Additional context
@RCGitBot
Copy link
Contributor

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

@MarkVillacampa
Copy link
Member

Hello @jesus-mg-ios

Thanks for reporting the issue. You mention this happens after resetting the purchase history for a user via AppStore Connect, is that correct?

Have you been able to reproduce the same issue in a newly created sandbox account? Sometimes, resetting the purchase history does not work correctly, takes long to become effective, or required a few tries.

@jesus-mg-ios
Copy link
Author

Well, I didn't reset the purchase history, only I reset eligibility. I don't know if for the case it is the Same @MarkVillacampa The problem is that Apple does this to test it during the review process.

@MarkVillacampa
Copy link
Member

Ah I see now, sorry I got the two mixed up.

When you say Apple's system indicates that the user is eligible for a free trial or introductory offer, where do you see that exactly?

The process described here to reset offer eligibility is known to take anywhere between 1h to 24h, it's not immediate, and there are many reasons that can affect how long it takes to go into effect, like caching etc.

https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/testing_introductory_offers

Just to confirm, now that it's been 24h+ since you initiated the reset, could you double check if the eligibility has been reset now?

Otherwise, I would go the more drastic route of deleting purchase history and/or creating a new sandbox account, at least for your own testing.

@jesus-mg-ios
Copy link
Author

24h+ later -> same result

@jesus-mg-ios jesus-mg-ios changed the title Check Intro Eligibility is Wrong in Sandbox (Not tested yet on Prod) Check Intro Eligibility is Wrong in Sandbox (Not tested yet on Testflight) Nov 22, 2024
@jesus-mg-ios jesus-mg-ios changed the title Check Intro Eligibility is Wrong in Sandbox (Not tested yet on Testflight) Check Intro Eligibility is Wrong in Sandbox (Not tested yet in Testflight) Nov 22, 2024
@MarkVillacampa
Copy link
Member

@jesus-mg-ios sorry to hear that. I wouldn't be surprised if that mechanism is not working correctly. Did you try deleting the purchase history from the Sandbox account directly from App Store Connect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants