Hybrid SDK Architecture at RevenueCat
Blog post from RevenueCat
RevenueCat faces a unique technical challenge in maintaining six different SDKs, including those for iOS, Android, and four hybrid frameworks: Flutter, ReactNative, Unity, and Cordova. These SDKs enable developers to write a single codebase for multiple platforms, aligning with RevenueCat's mission to help developers monetize and grow their app businesses. The company has developed a streamlined architecture to address the complexity of maintaining these SDKs, using an intermediary library called purchases-hybrid-common to reduce maintenance costs and accelerate release times. This library facilitates communication between hybrid frameworks and native platforms by transforming data types and routing calls, such as the essential "getOfferings" method, through a unified process. Though initially daunting, the architecture simplifies development by unifying logic previously duplicated across SDKs, reducing bugs, and improving efficiency. Future improvements may include transitioning more code to Kotlin/Swift and adopting third-party serialization libraries. RevenueCat remains open to community contributions to refine its SDKs further.