A cocktail discovery app demonstrating a production-quality Purchasely SDK integration. Built with native technologies on both platforms: Kotlin/Jetpack Compose on Android and SwiftUI on iOS.
| Feature | Android | iOS | Placement |
|---|---|---|---|
| Onboarding paywall | fetchPresentation + display |
fetchPresentation + display |
onboarding |
| Recipe detail paywall | presentationView |
presentationController |
recipe_detail |
| Favorites paywall | presentationView |
presentationController |
favorites |
| Filters paywall | presentationView |
presentationController |
filters |
| User login/logout | userLogin / userLogout |
userLogin / userLogout |
- |
| Restore purchases | restoreAllProducts |
restoreAllProducts |
- |
| User attributes | setUserAttribute / incrementUserAttribute |
setUserAttribute / incrementUserAttribute |
- |
| Event listener | EventListener |
PLYEventDelegate |
- |
| Paywall interceptor | setPaywallActionsInterceptor |
setPaywallActionsInterceptor |
- |
| Deep linking | isDeeplinkHandled |
isDeeplinkHandled |
- |
| Premium gating | userSubscriptions |
userSubscriptions |
- |
- A Purchasely Console account with an API key
- Android: Android Studio + JDK 11+
- iOS: Xcode 15+ with CocoaPods
cd android- Copy
local.properties.exampletolocal.properties - Set
purchasely.apiKey=YOUR_API_KEY - Build and run:
./gradlew :app:assembleDebugcd ios- Copy
Config.xcconfig.exampletoConfig.xcconfig - Set
PURCHASELY_API_KEY = YOUR_API_KEY - Install dependencies and build:
pod install
xcodegen generate
pod install
open Shaker.xcworkspaceBuild with Cmd+B in Xcode.
Create the following in your Purchasely Console:
- Entitlement:
SHAKER_PREMIUM - Placements:
onboarding- shown on first launchrecipe_detail- shown when viewing locked recipe contentfavorites- shown when accessing favorites featurefilters- shown when accessing filters feature
- Plans: At least one subscription plan granting the
SHAKER_PREMIUMentitlement
Both platforms follow MVVM with a shared data model:
cocktails.json -> CocktailRepository -> ViewModel -> UI
|
Purchasely SDK
(paywalls, entitlements, user attributes)
- Android: MVVM + Koin DI + Jetpack Compose + NavHost + kotlinx.serialization
- iOS: MVVM + SwiftUI + NavigationStack + Codable
Shaker/
├── shared-assets/ # Shared cocktail data and images
│ ├── cocktails.json # 25 cocktails with full data
│ └── images/ # Placeholder SVG images
├── android/ # Android app (Kotlin/Jetpack Compose)
│ ├── app/src/main/java/com/purchasely/shaker/
│ │ ├── data/ # Repositories + PremiumManager
│ │ ├── di/ # Koin DI modules
│ │ ├── domain/model/ # Data models
│ │ ├── ui/components/ # Shared composables
│ │ └── ui/screen/ # Screens (home, detail, favorites, settings, onboarding)
│ └── build.gradle.kts
└── ios/ # iOS app (SwiftUI)
├── Shaker/
│ ├── Data/ # Repositories + PremiumManager
│ ├── Helpers/ # ViewControllerResolver, CocktailImage
│ ├── Model/ # Data models
│ └── Screens/ # Screens (Home, Detail, Favorites, Settings, Onboarding)
├── project.yml # XcodeGen spec
└── Podfile