Push Notifications (iOS)

Push Notifications (iOS)

Lucra uses push notifications to alert users about contest updates.

Because the Lucra SDK runs inside your app, it relies entirely on your APNs setup — Lucra does not send notifications directly to devices.


🔧 Prerequisites

To use Lucra push notifications, ensure:

  1. Your app is already configured for APNs (Apple Push Notification Service).

Lucra uses this information to route notifications through your app.

If your app is not yet configured for APNs, follow Apple’s setup flow for push notifications before integrating Lucra.


📌 Registering the Device Token

When APNs returns a device token, call registerForPushNotifications to pass it to the SDK:

class AppDelegate: NSObject, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
    ) {
        lucraClient.registerForPushNotifications(deviceToken: deviceToken)
    }
}

Call this every time iOS issues a new token.


📨 Handling Lucra Notifications

When a notification arrives, pass it to Lucra. If it is a Lucra notification, the SDK returns a LucraFlow to present.

Where to call this?

  • userNotificationCenter(_:didReceive:withCompletionHandler:)

  • When user taps a custom in‑app alert

  • From your push-handling coordinator


🧪 Testing Push Notifications

To test in sandbox:

  1. Provide Lucra with a test device token.

  2. Ask your Lucra contact to send test notifications.

  3. Validate that:

    • The app receives the notification

    • handlePushNotification returns a LucraFlow

    • The correct flow presents full screen


✔️ Integration Checklist

Your push notification integration is complete.

Last updated