Solved

Update documentation to use react-native-purchases with Expo EAS


Badge +3

Hi ! 
With EAS build we can now use react-native-purchases without eject according to this discussion : 
https://forums.expo.dev/t/has-anyone-successfully-adopted-iap-with-eas-build-for-their-managed-app/54047/17

Can you update your documentation ?
regards,
Sephyre

icon

Best answer by jazmine 11 August 2021, 18:38

View original

10 replies

Userlevel 3
Badge +7

Hi @Sephyre :wave: ,

Thank you for bringing this to our attention. We will update our documentation to reflect this! 

Badge +3

Documentation is still not update ?

Lots of people asked me for a guide so I did: https://medium.com/@jonathan.payet/expo-in-app-purchase-for-managed-app-cdcd643de28d

Badge

Hi ! 
With EAS build we can now use react-native-purchases without eject according to this discussion : 
https://forums.expo.dev/t/has-anyone-successfully-adopted-iap-with-eas-build-for-their-managed-app/54047/17

Can you update your documentation ?
regards,
Sephyre

Hi sephyre, I saw your post on Expo forums and wondered if you could answer some questions for me?

It would be awesome if you could contact me in anyway. @mercpls on twitter.

I was wondering how you got around the linking required for revenue cats react native install.

Thanks!

Badge

Hi @Marcus Lee, I successfully installed react-native-purchases in an Expo managed project (ie. not ejected), linking is not required, I just installed it with npm as any package.

 

You will need however to build using EAS and use the custom Expo dev client instead of the default Expo app (Expo Go), more info on that here => https://blog.expo.dev/introducing-custom-development-clients-5a2c79a9ddf8

 

I followed the guide from Jonathan Payet mentioned above and there is nothing special to do on react-native-purchases side. The hardest part for me was to understand the Expo ecosystem as they are so many options (what is EAS, what is custom Expo client...).

Hi @Sephyre :wave: ,

Thank you for bringing this to our attention. We will update our documentation to reflect this! 

The documentation is still very out of date. I would be happy to help update it. 

Badge +1

I’ve installed `react-native-purchases` in the same way, however I can’t see any debug logs. Did you get debug logs to work with expo? I have set `await Purchases.setDebugLogsEnabled(true)`.

Badge +1

@Thomas I’m not sure this is the best way but the only way I’ve figured out to view the debug logs is to connect my device to my computer via usb. Open up the ‘Instruments’ app that comes with Xcode (https://g.co/kgs/GJ2FsV), choose “Logging”  and then connect it to the running app process on your phone.

 

 

Tap the red circle top left, to start recording and then interact with your app as normal. Logs should appear there.

Badge +1

Hi Nizza, thanks for the help! I actually figured out the same and am now using Console.app (filter set to my app) to view the iOS logs and `adb shell logcat | grep Purchases` on Android.

It would be great if RevenueCat would also display the messages in the Javascript logs for React Native.

 

Userlevel 4
Badge +8

@Sephyre Thanks so much for creating that guide!

 

I’m sorry that we still haven’t had a chance to update docs for this specific workflow. I’ve raised this up with the team, and I don’t have an ETA to give you but we’ll try to get it updated soon. 

 

Thanks again for bringing this into our attention in the first place and for the guide! 

Badge +1

@Thomas thanks for sharing the Console.app tip, much easier than using the Instruments app :sweat_smile:

Reply