Question

await Purchases.getOfferings(); hangs/never resolves

  • 12 September 2023
  • 3 replies
  • 131 views

Badge +2

I am trying to add Revenue Cat to my application and I am getting an unexpected behaviour. await Purchases.getOfferings(); never finishes. It hangs.

 

try {
    console.log('This logs')
    const offerings = await Purchases.getOfferings();    
    console.log('This does not log');
if (offerings.current !== null) {
    ….
}
} catch (error) {
    new Error(`Error getting offerings from Revenue Cat ${error}`);
}
 
 
I am unsure why this happens.
 
This are the logs
 
 
2023-09-12 15:06:48.379841+0200 someApp[4687:37716] [configure] INFO: ℹ️ Purchases instance already set. Did you mean to configure two Purchases objects?
2023-09-12 15:06:48.380048+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Configuring SDK using RevenueCat's UserDefaults suite.
2023-09-12 15:06:48.380078+0200 someApp[4687:53865] Opened database at /Users/john/Library/Developer/CoreSimulator/Devices/3B433335-5FEA-4324-BCD4-4CBB677C5A4E/data/Containers/Data/Application/F8725A65-E28B-4E6B-BAE0-E0058C257495/Documents/foo.db
2023-09-12 15:06:48.380330+0200 someApp[4687:37716] [identity] DEBUG: 👤 Identifying App User ID
2023-09-12 15:06:48.381805+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Debug logging enabled
2023-09-12 15:06:48.381882+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ SDK Version - 4.25.9
2023-09-12 15:06:48.381953+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Bundle ID - org.reactjs.native.example.someApp
2023-09-12 15:06:48.382009+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ System Version - Version 16.4 (Build 20E247)
2023-09-12 15:06:48.382058+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Using a simulator. Ensure you have a StoreKit Config file set up before trying to fetch products or make purchases.
See https://errors.rev.cat/testing-in-simulator for more details.
2023-09-12 15:06:48.382102+0200 someApp[4687:37716] [configure] DEBUG: 👤 No initial App User ID
2023-09-12 15:06:48.382167+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Purchases is configured with response verification disabled
2023-09-12 15:06:48.382835+0200 someApp[4687:37716] [configure] DEBUG: ℹ️ Delegate set
2023-09-12 15:06:48.383810+0200 someApp[4687:53865] [offering] DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground
2023-09-12 15:06:48.383957+0200 someApp[4687:46696] [network] DEBUG: ℹ️ GetOfferingsOperation: Started
2023-09-12 15:06:48.384057+0200 someApp[4687:46696] [network] DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943/offerings
2023-09-12 15:06:48.385855+0200 someApp[4687:46696] [network] DEBUG: ℹ️ API request started: GET '/v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943/offerings'
2023-09-12 15:06:48.410531+0200 someApp[4687:38819] [Default] Error enumerating unfinished transactions: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
2023-09-12 15:06:48.555043+0200 someApp[4687:37716] [native] (ADVICE) View #715 of type RCTView has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this, or apply the shadow to a more specific component.
2023-09-12 15:06:48.555266+0200 someApp[4687:37716] [native] (ADVICE) View #713 of type RCTView has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this, or apply the shadow to a more specific component.
2023-09-12 15:06:48.662734+0200 someApp[4687:53865] Opened database at /Users/john/Library/Developer/CoreSimulator/Devices/3B433335-5FEA-4324-BCD4-4CBB677C5A4E/data/Containers/Data/Application/F8725A65-E28B-4E6B-BAE0-E0058C257495/Documents/foo.db
2023-09-12 15:06:48.732957+0200 someApp[4687:53867] [javascript] (ADVICE) View #715 of type RCTView has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this, or apply the shadow to a more specific component.
2023-09-12 15:06:48.733456+0200 someApp[4687:53867] [javascript] (ADVICE) View #713 of type RCTView has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this, or apply the shadow to a more specific component.
2023-09-12 15:06:48.803260+0200 someApp[4687:37716] [offering] DEBUG: ℹ️ No cached Offerings, fetching from network
2023-09-12 15:06:48.811206+0200 someApp[4687:53865] [network] DEBUG: ℹ️ Network operation 'GetOfferingsOperation' found with the same cache key 'GetOfferingsOpe…'. Skipping request.
2023-09-12 15:06:48.946838+0200 someApp[4687:53865] [network] DEBUG: ℹ️ API request completed: GET '/v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943/offerings' (304)
2023-09-12 15:06:48.947181+0200 someApp[4687:53865] [offering] ERROR: 🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 1.)
There are no products registered in the RevenueCat dashboard for your offerings. If you don't want to use the offerings system, you can safely ignore this message. To configure offerings and their products, follow the instructions in https://rev.cat/how-to-configure-offerings.
More information: https://rev.cat/why-are-offerings-empty
2023-09-12 15:06:48.947462+0200 someApp[4687:53865] [offering] ERROR: 🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 1.)
There are no products registered in the RevenueCat dashboard for your offerings. If you don't want to use the offerings system, you can safely ignore this message. To configure offerings and their products, follow the instructions in https://rev.cat/how-to-configure-offerings.
More information: https://rev.cat/why-are-offerings-empty
2023-09-12 15:06:48.947639+0200 someApp[4687:53865] [network] DEBUG: ℹ️ GetOfferingsOperation: Finished
2023-09-12 15:06:48.947703+0200 someApp[4687:37716] [error] ERROR: 😿‼️ There is an issue with your configuration. Check the underlying error for more details. There are no products registered in the RevenueCat dashboard for your offerings. If you don't want to use the offerings system, you can safely ignore this message. To configure offerings and their products, follow the instructions in https://rev.cat/how-to-configure-offerings.
More information: https://rev.cat/why-are-offerings-empty
2023-09-12 15:06:48.947866+0200 someApp[4687:53865] [network] DEBUG: ℹ️ Serial request done: GET /v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943/offerings, 0 requests left in the queue
2023-09-12 15:06:48.947885+0200 someApp[4687:46696] [network] DEBUG: ℹ️ GetCustomerInfoOperation: Started
2023-09-12 15:06:48.948107+0200 someApp[4687:46696] [network] DEBUG: ℹ️ There are no requests currently running, starting request GET /v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943
2023-09-12 15:06:48.949344+0200 someApp[4687:46696] [network] DEBUG: ℹ️ API request started: GET '/v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943'
2023-09-12 15:06:49.068248+0200 someApp[4687:53865] Opened database at /Users/john/Library/Developer/CoreSimulator/Devices/3B433335-5FEA-4324-BCD4-4CBB677C5A4E/data/Containers/Data/Application/F8725A65-E28B-4E6B-BAE0-E0058C257495/Documents/foo.db
2023-09-12 15:06:49.084358+0200 someApp[4687:46696] [network] DEBUG: ℹ️ API request completed: GET '/v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943' (304)
2023-09-12 15:06:49.087327+0200 someApp[4687:46696] [customer] DEBUG: 😻 CustomerInfo updated from network.
2023-09-12 15:06:49.087499+0200 someApp[4687:46696] [network] DEBUG: ℹ️ GetCustomerInfoOperation: Finished
2023-09-12 15:06:49.087698+0200 someApp[4687:46696] [network] DEBUG: ℹ️ Serial request done: GET /v1/subscribers/$RCAnonymousID%3Af4ad6ce1f4324e6191e9698826537943, 0 requests left in the queue
 
 
This happens in iOS 16.x simulator with Revenue Cat running in React Native
 
"react-native-purchases": "^6.6.5",
"react-native": "0.71.7",

3 replies

Badge +2

Strange, it works when I add offerings in the Revenue Cat Dashboard. This is unexpected and should be changed and Quick Start Guide since Offerings are marked as optional.

Userlevel 4
Badge +6

Hi @Christoph,

Offerings are optional but the fetchOfferings call wouldn’t complete unless offerings are set up - otherwise there’s nothing for it to fetch, and it throws an error. I can look into making this more clear in our documentation.

Badge +2

Hi @kaitlin 

thanks for the reply.

It did not throw an error, it just hang and never resolved… That is what confused me. :)

Any, solved it. Thanks.

 

There is another problem arising. Maybe you can have a look?

 

Reply