Skip to content

iOS (Swift)

Install

In Xcode: File → Add Package Dependencies → https://github.com/heysada/sada-ios, then add the HeysadaNida library to your target.

One Swift package holds all our SDKs, so it has one version for every product: you update them together. Every library links the same binary, HeysadaKit, so an app carries every product’s code, whichever libraries it uses (an iOS app can hold one Kotlin runtime, so the products share one framework).

The in-app messages SDK for iOS: SwiftUI over the Kotlin Multiplatform SDK, which draws every format (splash, stories, carousel, countdown, coupon, lucky draw, floating button, toast, daily check-in) from the app’s design.

Use it

import HeysadaNida

await NidaApp.configure(appKey: "ipk_…", apiUrl: "https://…", placements: ["home_top", "home_popup"],
                        onOpenUrl: { url, _ in UIApplication.shared.open(url) })
await NidaApp.identify(user.id, userHash: user.hash)

ContentView()
    .nidaMessages()                       // popups, splashes and stories over the app

NidaBanner(placement: "home_top")         // a banner where it sits
    .frame(height: 140)

NidaStoriesRow(placement: "home_stories") // a stories placement: its row of rings
    .frame(height: 96)                    // a ring opens the viewer over the app (.nidaMessages())

await NidaApp.event("add_to_cart")        // messages set to show when this happens

// The AppDelegate's push callbacks:
await NidaApp.registerAPNs(deviceToken: token, sandbox: isDebugBuild)
await NidaApp.handlePush(userInfo: response.notification.request.content.userInfo)

The server decides every claim, play and check-in; the SDK draws the view the service sends back with the result. Pushes are sent with the org’s own APNs key or Firebase project, which the org sets in the panel’s settings.

Develop

./check.sh    # builds the KMP XCFramework, runs the Swift tests on an iOS simulator