Skip to main content
Use pnlight_sdk to add PNLight to a Flutter app on iOS.

Requirements

  • Flutter 3.3.0+
  • Dart 2.17.0 or later, below 4.0.0
  • iOS 12.0+

Install

Add the package:
Package page: pnlight_sdk on pub.dev. Flutter SDK version

iOS setup

If you use RemoteUiView, add the DivKit CocoaPods source to ios/Podfile before other sources:
If your app collects IDFA on iOS 14.0+, add NSUserTrackingUsageDescription to Info.plist:

Initialize the SDK

If you use Remote Config, provide local defaults during initialization:

Common calls

logEvent sends optional in-app events to PNLight. You can review them in Analytics → App Events, on the Events page, and in customer timelines.

Remote Config

Fetch Remote Config after initialization. Read values with typed getters and fallbacks your app owns.
By default, fetchAndActivate waits briefly for AppsFlyer attribution and uses a 15-minute minimum fetch interval. See Remote Config for fetch results, local defaults, and all supported value types.

IDFA after ATT

If PNLight initializes before the App Tracking Transparency prompt completes, call updateIdfa() after authorization so PNLight receives the granted IDFA.

Remote UI

Use onPurchased when a schema v3 or v4 Remote UI document starts a purchase with pnlight.purchase and the app needs to refresh entitlements after StoreKit verifies it.
The Flutter package wraps the PNLight iOS SDK. Do not call PNLight SDK methods on unsupported platforms.