Skip to main content

I’m using Ionic with Capacitor.

The RevenueCat documentation recommends using a cordova plugin, but Ionic has been in the process of migrating away from Capacitor for the past few years, and this is now the only Cordova plugin in my app.

There’s already a capacitor plugin on github but I was wondering if there are any plans to release an official Capacitor plugin as well.

Hey @programador, I’m Martin, the maker of capacitor-purchases.

I have been contacted by@Andy from RevenueCat, and the plugin will be transferred to their org soon :)

I’m happy to let them maintain it, and integrate it into their doc.

We just need a bit of time to proceed with this change!

Until then, you can use my version, outside the name, nothing should change since I have used the same approach as they do for all of their plugins.

Hope you many subcriptions 🤘


Hey folks! Just here to also confirm @Martin Donadieu’s words. I’m personally really excited about this, and looking forward to having better support for Capacitor! Stay tuned for the official announcement, and feel free to use capacitor-purchases in the meantime. 


Yes! We do plan on updating to the latest version of our Android SDK soon, and well before the Nov 1st deadline. Stay tuned! 


Another vote for an official Capacitor plugin.

The biggest issue I have with the Cordova plugin is that I can’t use the latest version until https://github.com/danielsogl/awesome-cordova-plugins/blob/master/src/%40awesome-cordova-plugins/plugins/purchases/index.ts is updated to use the new version.

Apparently the process for updating that file is to wait until a RevenueCat (RC) customer questions RC why the version is old, then RC makes a pull request to update it, then sometime in the future it is updated and can be used in Ionic.

I’m on my third cycle of this now and since my app is stuck on “getOfferings hangs”, which has been a problem for over a year in RC, I can’t even get the latest versions to see if those will help because of how they are pegged to a third party version.


I’m using Ionic with Capacitor.

The RevenueCat documentation recommends using a cordova plugin, but Ionic has been in the process of migrating away from Capacitor for the past few years, and this is now the only Cordova plugin in my app.

There’s already a capacitor plugin on github but I was wondering if there are any plans to release an official Capacitor plugin as well.

We are in the exact same situation. We have migrated all of our cordova plugins to their capacitor equivalents, and now only the RevenueCat plugin is left as cordova in our app.
 

As can be seen in the Capacitor vs Cordova comparison here, cordova is dying and Capacitor already took its place with more than 5 times the downloads on npm.

 

That would be great if Revenuecat launches an official Capacitor plugin as well.


Hi everyone! We have released the first beta of the capacitor plugin! https://www.npmjs.com/package/@revenuecat/purchases-capacitor. Please check it out and let us know if you run into any issues or feedback. We will finish the public documentation soon, so it's easier to implement.


Hey folks, we’re currently working on it! I don’t have any updates to share just yet, but will probably have something by end of week or next week. 


Hi @IrishCoder88, that’s correct. You need to create an android app inside the same project in the RC dashboard for each platform. You can check more info here: https://www.revenuecat.com/docs/projects#adding-an-app-to-a-project and https://www.revenuecat.com/docs/android-products


Hi @anuradha-a4da7c, we created this plugin using Capacitor 5 directly so we don’t have a version using Capacitor 4.x. What issues are you finding with Capacitor 4.x? Also, is it possible for you to update to Capacitor 5?

Hi @toni-rico - I could not install the npm package due to its peer dependency of Capacitor 5.x. However, I force installed to see how it works with Capacitor 4.x. Currently testing the implementation, so far seems to work well. If we run into issues, will keep you posted. 

Thanks for your response.


Hi @IrishCoder88,

You need to pass the whole object returned by `getProducts` into the `purchaseStoreProduct`. So the code would look like:

const products = await Purchases.getProducts({ 
productIdentifiers: ['onetimeproduct'],
type: PRODUCT_CATEGORY.NON_SUBSCRIPTION
}).products;
// Remember to account for the product not being found!
const purchaseResult = await Purchase.purchaseStoreProduct({ product: products[0] });

Lmk if you still have any issues!


I’ve got that working now. Thanks @toni-rico


Hi @bebofit and all! The docs for the Capacitor plugin have been published: https://www.revenuecat.com/docs/ionic. Please take a look and let us know if you run into any issues!


@toni-rico Awesome news, thank you so much for all your efforts.


We’re almost ready to ship! You can follow the progress over at https://github.com/RevenueCat/purchases-capacitor/pull/96

 

We’ll hopefully be able to ship it very soon


are there any updates regarding the new supported version for capacitor?


Hey @programador, I’m Martin, the maker of capacitor-purchases.

I have been contacted by@Andy from RevenueCat, and the plugin will be transferred to their org soon :)

I’m happy to let them maintain it, and integrate it into their doc.

We just need a bit of time to proceed with this change!

Until then, you can use my version, outside the name, nothing should change since I have used the same approach as they do for all of their plugins.

Hope you many subcriptions 🤘

 

Love to read about this! i’m considering implementing Revenuecat into my app for over a year now, but still hesitant because there is no “safe path” for adding Revenuecat into my capacitor (vue3) project. Looking forward to any updates on this transition.


Hey @programador, I’m Martin, the maker of capacitor-purchases.

I have been contacted by@Andy from RevenueCat, and the plugin will be transferred to their org soon :)

I’m happy to let them maintain it, and integrate it into their doc.

We just need a bit of time to proceed with this change!

Until then, you can use my version, outside the name, nothing should change since I have used the same approach as they do for all of their plugins.

Hope you many subcriptions 🤘

Wow great news! Thanks for your hard work.


Any update on this @Jacob Eiting ? At least some info would be nice to know if there is or isn’t any plans for an official Capacitor plugin so that we can plan accordingly. 

 

The guy who maintains this plugin seems to be doing a good job: https://github.com/Cap-go/capacitor-purchases

 

Maybe sth can be arranged to turn his Cap. plugin into an official RC plugin? That way we would feel safer to know that it is being overlooked by the official RC team.

 

Thanks.


A capacitor v3/4 plugin would be great.

@Jeff Johnson, it sounds like you’re using the Ionic Native / Awesome Plugins wrapper. If you’re on capacitor, you may find it easier to just use the `cordova-plugin-purchases` npm library directly. 

For example, I’m using it in an Ionic 5 / Angular 12 / Cap 4 project, and just `declare var Purchases;` at the top of my RevenueCat service, and then get direct access to its methods, like `Purchases.setup(RevCatAPIKey, user.id)` and `Purchases.purchasePackage`;  


I just saw that you guys released the version 8.0.0 in prod.Si I installed this one instead of the beta and have the same problem. 

I need to do a release tomorrow, I would love to have that working.

 

Any help? Thanks a lot

 

 


Hi @Undisconnected 

You should be able to specify the exact version you want to install, like

npm i @revenuecat/purchases-capacitor@8.0.0-beta.3

 


Hi @Undisconnected,

That seems like a different issue. From that error message, it seems that your minimum deployment target might be lower than the one compatible for the SDK. Was this issue happening in a previous version of the SDK? Also, what minimum version are you using in your app? For reference, this is the Podfile in our sample app: https://github.com/RevenueCat/purchases-capacitor/blob/7cd4c6343f194d109c14fc1314914a6c64e5ff36/example/purchase-tester/ios/App/Podfile#L3. And you can also check the deployment version if you open your project in Xcode:  

Could you let us know your minimum version in those places?


@toni-rico Thanks for this, sorry, I had to work on something else for a while. I’d be interested to test it, but I have no idea how to include this in my project.

I generally go with npm i @revenuecat/purchases-capacitor 

It seems in the package you are using typescript vs Js in the npm package. Not sure if that’s gonna be a problem. 

I’m gonna test to use --legacy-peer-deps with the current version for now, but I’m happy to test the beta if you explain a bit more how to test it. 

 

Thanks 

 

 

 


Hi @Undisconnected,

We released a version version 8.0.0-beta.2 with support for Capacitor 6. We plan to release this version as stable soon

Please let us know if you have any issues with that!


Ok so I manage to reinstall the version that was working for my app before, and everything works fine again. ("@revenuecat/purchases-capacitor": "^7.5.10"). I just had to force it using the --force with npm. 

The minimum version is iOS 13.0 in xCode.

 

Are you suppose to do anything about Pods when you change version of the plugin?