React Native
A TypeScript API backed by the native iOS and Android SDKs. The support screen is native on both platforms.
Install#
Requires React Native 0.74+ with autolinking. The package's podspec depends on the Parley iOS pod; on Android it depends on app.parleyai:parley-android.
Use#
| Name | Type | Description |
|---|---|---|
| configure({ appKey, apiUrl?, appearance? }) | void | Call once, before anything else. |
| identify({ userId, userHash?, email?, name?, avatarUrl?, attributes? }) | Promise<void> | |
| updateCustomer({ email?, name?, attributes? }) | Promise<void> | |
| track(name, properties?) | Promise<void> | |
| logout() | Promise<void> | |
| presentSupport() | void | Presents the native support screen. |
| registerPushToken(token) | Promise<void> | APNs (hex) on iOS, FCM token on Android. |
| useUnreadCount() | hook | Re-renders on unread changes. |
| addUnreadCountListener(cb) | { remove() } | Non-hook subscription. |
| offers() | Promise<Offer[]> | Active offers for this customer. |
| requestReviewIfEligible() | Promise<boolean> | Calls the platform review API if eligible. |
Using Expo? Follow the Expo guide — you'll need a development build.