First time user trying to setup RevenueCat. I am attempting to use `react-native-purchases` in an Expo app build using a dev-client approach (https://medium.com/@jonathan.payet/expo-in-app-purchase-for-managed-app-cdcd643de28d). I have it getting Offerings successfully in sandbox mode for iOS, but the result is empty on Android:
1 if (Platform.OS === 'ios') {2 await Purchases.setup("appl_myactualkey");3 } else if (Platform.OS === 'android') {4 await Purchases.setup(`goog_myactualkey`);5 } else {6 console.error('Unknown OS type - Purchases will be broken!');7 }8 try {9 const offerings = await Purchases.getOfferings();10 console.error("RevenueCat: ", offerings);11 // const products = await Purchases.getProducts();12 // console.error("RevenueCat Products: ", products);13 } catch (e) {14 console.error(e);15 }
Result on Android, on stdout:
1RevenueCat: , Object {2 "all": Object {},3 "current": null,4}
However, if I use the REST API according to the docs:
1curl --request GET \2> --url https://api.revenuecat.com/v1/subscribers/app_user_id/offerings \3> --header 'Accept: application/json' \4> --header 'Authorization: Bearer goog_myactualkey' \5> --header 'Content-Type: application/json' \6> --header 'X-Platform: android'
I get results!
1{"current_offering_id":"[redacted]","offerings":[{"description":"[redacted]","identifier":"[redacted]","packages":[{"identifier":"$rc_monthly","platform_product_identifier":"[redacted]"}]},{"description":"[redacted]","identifier":"[redacted]","packages":[{"identifier":"$rc_annual","platform_product_identifier":"[redacted]"}]}]}