Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining paid and free version of single react native app

I have a react native app that is released on the PlayStore. Now I want to create a paid app with more features.

The paid app would be the free app plus a couple of other features. I use vanilla React Native.

How shoul I structure my repository and my workflow so that in the end I wouldn't have to maintain two different apps.

like image 674
Aswin Mohan Avatar asked Jan 17 '26 12:01

Aswin Mohan


1 Answers

I'm not familiar with react native, but in general. There are a few ways to handle this.

One code base with flag

If you want to maintain one code base you can create some kind of paidVersion flag in your code. If the flag is false, certain buttons that allow the user to use paid features are simply hidden. If the flag is true, the buttons that allow the user to use paid features are visible.

This is probably the easiest thing to do.

Two branches

Software companies oftentimes find themselves in a position where they maintain a free open source version of their software, and a paid closed source version of the same software with some extra features. To minimize the effort of maintaining the two products which are basically the same, they do the following.

  • The free version is maintained on branch A.
  • The paid version is forked from branch A and is maintained in branch B

Now there are three cases to consider when you change the product.

  • Changes that are used by both the free and paid version: These changes are merged into branch A, then branch B is rebased onto branch A.
  • Changes that only go to the paid version: These changes only get pushed to branch B
  • Changes that only go into the free version: This is a bad case and don't do it, because then you start going down the path of maintaining two different products.

Plugin Framework

Make the free version of you product support plugins. The paid version of the product is simply the free version with a plugin bundled with it.

Conclusion

The right method to use primarily depends on what the nature of what you are building. If the product you are building is very complicated (like an IDE) and may have multiple optional paid features, then you may want to use some kind of plugin framework.

If the product is simple and you have no intention of sharing the source code of either the free or paid version, then using a paidVersion flag is the best route.

If you want to share the source code of the free product, then you should probably use the two branches strategy.

like image 187
ilooner Avatar answered Jan 20 '26 04:01

ilooner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!