Skip to content

Conversation

joshdholtz
Copy link
Member

@joshdholtz joshdholtz commented Aug 17, 2025

Motivation

Coming soon

Description

Slot

import RevenueCatUI

PurchasesUI.register { identifier in
    if identifier == "chart" {
        PaywallChartInteractiveView()
    }
}

RevenueCat Components Plugins

By Developer

import RevenueCatUILottie

PurchasesUI.register([
    PurchasesUI.Lottie
])

Or we can do magic

But this has a chance of not working since there would be no import RevenueCatUILottie so RevenueCatUILottie might get removed out of the binary. But... it might not hurt to just do incase the user forgets? 🤷‍♂️

One thing we would need to do is probably include the names of the plugins being used like RCUILottiePlugin in the paywalls/offerings response so the SDK knows which plugins to try to register automatically.

// Load plugin names (like "RCUILottiePlugin") from paywalls response
// so we can regsiter them if they exist without explicity lines of code from user
if let cls = NSClassFromString("RCUILottiePlugin") as? NSObject.Type,
   let flavor = cls.init() as? PurchasesUIPlugin {
       flavor.register()
}

By Us (when implementing)

@_spi(Internal) import RevenueCatUI

extension PurchasesUI {

    // IMPORTANT: This is needed for the way for developer to register this plugin
    public static let Lottie: PurchasesUIPlugin = LottiePlugin()

    @objc(RCUILottiePlugin)
    private class LottiePlugin: NSObject, PurchasesUIPlugin {

        override internal init() { }

        public func register() {

            // IMPORTANT: This is the thing actually needed to register the component type
            // to be rendered 
            PurchasesUI.register(type: .slotLottie) { component in
                switch component {
                case .slotLottie(let slotLottie):
                    switch slotLottie.value {
                    case .url(let url):
                        LottieView(url: url)
                    case .unknown:
                        EmptyView()
                    }
                default:
                    EmptyView()
                }
            }

        }

    }

}

Copy link

emerge-tools bot commented Aug 18, 2025

⚠️ 3 new unused protocols, 3 builds increased size

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 12.7 MB ⬆️ 96.6 kB (0.76%) 49.1 MB ⬆️ 417.2 kB (0.86%) N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
1.0 (1) 11.7 MB ⬆️ 88.7 kB (0.76%) 43.6 MB ⬆️ 365.1 kB (0.84%) N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
1.0 (1) 11.7 MB ⬆️ 88.7 kB (0.76%) 43.6 MB ⬆️ 365.1 kB (0.84%) N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚠️ Found new unused protocol: PurchasesUIPlugin
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 417.2 kB (0.86%)
Total download size change: ⬆️ 96.6 kB (0.76%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 162.4 kB
Code Signature ⬆️ 10.4 kB
DYLD.Exports ⬆️ 10.2 kB
📝 RevenueCatUI.SlotLottieComponentViewModel.SlotLottieComponentView... ⬆️ 7.5 kB
📝 RevenueCatUI.SlotComponentViewModel.SlotComponentViewModel ⬆️ 5.1 kB
View Treemap

Image of diff

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad

⚠️ Found new unused protocol: PurchasesUIPlugin
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 365.1 kB (0.84%)
Total download size change: ⬆️ 88.7 kB (0.76%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 124.7 kB
DYLD.Exports ⬆️ 10.2 kB
Code Signature ⬆️ 8.5 kB
📝 RevenueCatUI.SlotLottieComponentViewModel.SlotLottieComponentView... ⬆️ 7.4 kB
📝 RevenueCatUI.SlotComponentViewModel.SlotComponentViewModel ⬆️ 4.8 kB
View Treemap

Image of diff

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac

⚠️ Found new unused protocol: PurchasesUIPlugin
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 365.1 kB (0.84%)
Total download size change: ⬆️ 88.7 kB (0.76%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 124.7 kB
DYLD.Exports ⬆️ 10.2 kB
Code Signature ⬆️ 8.5 kB
📝 RevenueCatUI.SlotLottieComponentViewModel.SlotLottieComponentView... ⬆️ 7.4 kB
📝 RevenueCatUI.SlotComponentViewModel.SlotComponentViewModel ⬆️ 4.8 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Copy link

emerge-tools bot commented Aug 18, 2025

📸 Snapshot Test

2 modified, 6 added, 703 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
2 0 1 0 234 0 ⏳ Needs approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
2 0 1 0 234 0 ⏳ Needs approval
RevenueCat
com.revenuecat.PaywallsTester
2 0 0 0 235 0 ⏳ Needs approval

🛸 Powered by Emerge Tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant