Lottie animations
How to make Lottie animations work on your paywalls
Lightweight, vectorial with a huge community, Lottie has become the leading technology to create animations in applications.
From now on you can add Lottie animations in Purchasely paywalls but it requires a little setup from your mobile developers.
This Lottie option is being added template by template. Don't hesitate to contact support to request a specific addition where you need it.
Why is there any setup?
At Purchasely we value having a lightweight SDK (< 2Mb) with no external dependencies.
Thus, when we wanted to offer Lottie animations we didn't want to add it as a direct dependency of our SDK. This would have multiplied by 5 the weight of our SDK and users who didn't use it would have had to have to pay that extra cost.
This is how we ended up doing a weak dependency.
How does it work?
At runtime, our SDKs will be looking at Lottie's presence and will add the view to its paywall. It will be able to configure the aspect (fill / fit) and wether or not the animation repeats.
As Purchasely SDK will be calling methods it needed a stable interface to avoid calling a method that wouldn't exist (and crash). This is why we created an interface to Lottie that will remain stable and will embed calls to Lottie framework so that we don't need to rely on them.
You will need to add this interface to your code and Lottie SDK in your dependencies.
Configuration
iOS
First you need to add the Lottie dependency (if not already in your app)
Then add the following Swift class to your code
🎉 You are all set!
Android
Lottie integration requires our SDK version 3.6.0 minimum
First you need to add the Lottie dependency (if not already in your app)
Then implements
PLYLottieInterface
, you can copy the following sampleAnimationView
classFinally add it to Purchasely with
Last updated