@pnlight/sdk-react-native for React Native apps that need PNLight on iOS.
Install
Initialize the SDK
Callinitialize once during app startup.
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.
IDFA after ATT
If PNLight initializes before the App Tracking Transparency prompt completes, callupdateIdfa() after authorization so PNLight receives the granted IDFA.
Remote UI component
UseRemoteUiView to fetch and render a placement. Add an onAction handler so your app can respond to actions from the returned UI.
Remote UI props
| Prop | Type | Description |
|---|---|---|
placement | string | Placement ID configured in PNLight. |
cardId | string | Optional card ID. Defaults to a placement-based value. |
secure | boolean | Deprecated. Secure rendering is controlled by the dashboard placement. |
preventRecording | boolean | Deprecated. Capture blocking is controlled by the dashboard placement. |
attributionRequired | boolean | Waits for attribution before returning a config when enabled. Defaults to true. |
ignoreCache | boolean | Waits for a fresh server response instead of serving a cached config. Defaults to false. |
onAction | function | Handles custom actions from the rendered UI. |
onError | function | Handles config loading errors. |