{"_id":"@dengage-tech/expo-dengage","_rev":"2-493b6a5b615b2a588caa04cd0dce86cb","name":"@dengage-tech/expo-dengage","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@dengage-tech/expo-dengage","version":"1.0.0","keywords":["expo","dengage","config-plugin","react-native"],"license":"MIT","_id":"@dengage-tech/expo-dengage@1.0.0","maintainers":[{"name":"hasnaintanv123","email":"hasnain.tanvir@dengage.com"},{"name":"alialtansaka","email":"npm@dengage.com"},{"name":"zeeshan_satti","email":"zeeshanqau2013@gmail.com"},{"name":"kamrankhankhail","email":"kamran.khankhail@gmail.com"},{"name":"nawaz4225","email":"nawaz.qadir@dengage.com"}],"dist":{"shasum":"5feea03f979983e2a482aa22b1b0778faecfcddd","tarball":"https://registry.npmjs.org/@dengage-tech/expo-dengage/-/expo-dengage-1.0.0.tgz","fileCount":11,"integrity":"sha512-drq6g9gKnganmfwqzbXNX1NwxGXpmYMiFy2YzXurBJGD6IcfSKSVHnyQAgEDpgLw2Ul4ZAmGyY1oNDysEY2sOQ==","signatures":[{"sig":"MEUCICqUDlkp0Dovp7b84vhZ6eXFpiA8F5Tb1BCnSXoZZxELAiEAg9/bpsNVySEu4HXi+rev8fpim2mwqTV+NCYKph+QB6Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53867},"main":"app.plugin.js","types":"build/plugin/index.d.ts","gitHead":"90f13099a5d848fb349a79c174fae5616ebdac08","scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf build","prepare":"npm run build"},"_npmUser":{"name":"hasnaintanv123","email":"hasnain.tanvir@dengage.com"},"_npmVersion":"10.9.2","description":"Expo config plugin for native Dengage setup during expo prebuild (Android + iOS).","directories":{},"_nodeVersion":"23.11.0","dependencies":{"@expo/config-plugins":"~54.0.4"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"~5.6.3"},"peerDependencies":{"expo":">=49.0.0","@dengage-tech/react-native-dengage":">=2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expo-dengage_1.0.0_1776800836929_0.6272975647674224","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dengage-tech/expo-dengage","version":"1.0.1","description":"Expo config plugin for native Dengage setup during expo prebuild (Android + iOS).","main":"app.plugin.js","types":"build/plugin/index.d.ts","scripts":{"clean":"rm -rf build","build":"tsc -p tsconfig.json","prepare":"npm run build"},"keywords":["expo","dengage","config-plugin","react-native"],"license":"MIT","dependencies":{"@expo/config-plugins":"~54.0.4"},"peerDependencies":{"expo":">=49.0.0","@dengage-tech/react-native-dengage":">=2.0.0"},"devDependencies":{"typescript":"~5.6.3"},"_id":"@dengage-tech/expo-dengage@1.0.1","gitHead":"5333d3e903587a15a282fa62fca1d0c412a9aa8e","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-zV2VZKGiG6ss3ieYrM7cSqC2s+JV5C114yEsNxTVYNWTflAaxwCi3KFjGlAYkVDus5KhY9/mzae0fn14oljwaw==","shasum":"744d43adf4f5dad8d64db6f82c9e542905b4db0a","tarball":"https://registry.npmjs.org/@dengage-tech/expo-dengage/-/expo-dengage-1.0.1.tgz","fileCount":11,"unpackedSize":57487,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDa7oku2iTWswx5LRDuWB5ee/DuMdJ83BJ7Uwq2beN3LwIgYPS48jdxiqleOE1ceI7zDZQ06VKl6VK7bcW4SMXs/Pk="}]},"_npmUser":{"name":"hasnaintanv123","email":"hasnain.tanvir@dengage.com"},"directories":{},"maintainers":[{"name":"hasnaintanv123","email":"hasnain.tanvir@dengage.com"},{"name":"alialtansaka","email":"npm@dengage.com"},{"name":"zeeshan_satti","email":"zeeshanqau2013@gmail.com"},{"name":"kamrankhankhail","email":"kamran.khankhail@gmail.com"},{"name":"nawaz4225","email":"nawaz.qadir@dengage.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/expo-dengage_1.0.1_1776982389839_0.14376863192710831"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-21T19:47:16.807Z","modified":"2026-04-23T22:13:10.159Z","1.0.0":"2026-04-21T19:47:17.088Z","1.0.1":"2026-04-23T22:13:09.990Z"},"license":"MIT","keywords":["expo","dengage","config-plugin","react-native"],"description":"Expo config plugin for native Dengage setup during expo prebuild (Android + iOS).","maintainers":[{"name":"hasnaintanv123","email":"hasnain.tanvir@dengage.com"},{"name":"alialtansaka","email":"npm@dengage.com"},{"name":"zeeshan_satti","email":"zeeshanqau2013@gmail.com"},{"name":"kamrankhankhail","email":"kamran.khankhail@gmail.com"},{"name":"nawaz4225","email":"nawaz.qadir@dengage.com"}],"readme":"# @dengage-tech/expo-dengage\n\nExpo **config plugin** that applies **native** Dengage wiring during **`expo prebuild`** (Android and iOS): Gradle and manifest changes, `Info.plist` keys, `AppDelegate` / `MainApplication` initialization snippets, optional geofence native modules, and related defaults.\n\nThis **README** is the full integration guide for installing and configuring the package in an Expo app, including how **`@dengage-tech/react-native-dengage`** (peer dependency) sits on top of that native layer and which JavaScript APIs you can call.\n\n---\n\n## What this plugin does (and does not do)\n\n| Responsibility | Owner |\n|----------------|--------|\n| Android: Gradle, Google Services plugin hook, `MainApplication` init snippet, manifest meta-data, FCM service registration, optional HMS pieces, optional geofence Gradle flag and dependency line, generated push receiver stub | **This plugin** (`@dengage-tech/expo-dengage`) |\n| iOS: `Info.plist` URL keys, `UIBackgroundModes` (`remote-notification`), `AppDelegate` init snippet, optional Podfile geofence flag | **This plugin** |\n| JavaScript APIs for campaigns, inbox, in-app messages, events, device identity, geofence control, etc. | **`@dengage-tech/react-native-dengage`** — import in your app and call methods; it forwards to native code |\n\n**Expo Go** does not load custom native code from this plugin. Use a **development build** (`expo run:ios` / `expo run:android`), **EAS Build**, or equivalent custom client.\n\n---\n\n## 1. Requirements\n\n| Item | Notes |\n|------|--------|\n| Expo SDK | **49 or higher** (`expo` in your app must satisfy the version range declared under `peerDependencies` of `@dengage-tech/expo-dengage`) |\n| Workflow | **Prebuild** (managed native `android/` and `ios/` folders generated or refreshed by Expo) |\n| Android | Firebase project for FCM; **`google-services.json`** available to the Expo config |\n| iOS | Apple Push Notification setup; **iOS integration key** from Dengage; **App Group** identifier agreed with your Dengage integration (used for shared storage with extensions when applicable) |\n| Keys | **Android (Firebase) integration key** and **iOS integration key** from the Dengage console |\n\n---\n\n## 2. Installation\n\nInstall this package in your Expo app root:\n\n```bash\nnpm install @dengage-tech/expo-dengage @dengage-tech/react-native-dengage\n```\n\nInstall every **`peerDependency`** listed in `@dengage-tech/expo-dengage/package.json` at compatible versions (Expo, plus any other entries). Use the same package manager for the whole tree (`npm`, `yarn`, or `pnpm`) so resolutions stay consistent.\n\n---\n\n## 3. Register the config plugin\n\nAdd the plugin to **`app.json`**, **`app.config.json`**, or **`app.config.js`** under `expo.plugins`.\n\n### 3.1 Minimum configuration\n\n```json\n{\n  \"expo\": {\n    \"plugins\": [\n      [\n        \"@dengage-tech/expo-dengage\",\n        {\n          \"androidFirebaseIntegrationKey\": \"YOUR_ANDROID_FIREBASE_INTEGRATION_KEY\",\n          \"iosIntegrationKey\": \"YOUR_IOS_INTEGRATION_KEY\",\n          \"iosAppGroup\": \"group.com.yourcompany.yourapp.dengage\"\n        }\n      ]\n    ]\n  }\n}\n```\n\n| Property | Purpose |\n|----------|---------|\n| `androidFirebaseIntegrationKey` | Passed into native Android initialization (`DengageRNCoordinator.setupDengage`). |\n| `iosIntegrationKey` | Passed into native iOS initialization (`DengageRNCoordinator.setupDengage`). |\n| `iosAppGroup` | App Group identifier used for Dengage-related shared user defaults (must match your Apple Developer configuration and Dengage guidance). Example shape: `group.com.company.app.dengage`. |\n\n### 3.2 Android — `google-services.json`\n\nPlace the file in your repository (commonly project root) and point Expo at it:\n\n```json\n{\n  \"expo\": {\n    \"android\": {\n      \"package\": \"com.yourcompany.yourapp\",\n      \"googleServicesFile\": \"./google-services.json\"\n    }\n  }\n}\n```\n\nExpo copies and wires this for the Google Services Gradle plugin during prebuild. The Android **`applicationId`** / package must match the Firebase app configuration.\n\n### 3.3 API endpoint overrides (optional)\n\nIf you omit these, the plugin sets **default** Dengage API base URLs on iOS (`Info.plist`) and Android (`<application><meta-data .../>`). For production, use the endpoints supplied by Dengage for your account.\n\n| Plugin property | Role |\n|-----------------|------|\n| `dengageEventApiUrl` | Event ingestion |\n| `dengagePushApiUrl` | Push (iOS key `DengageApiUrl`) |\n| `dengageDeviceIdApiUrl` | Device / identifier endpoints |\n| `dengageInAppApiUrl` | In-app messaging (fullscreen, **real-time in-app**, and feeds used by **in-app inline** and **App Story** native views) |\n| `dengageGeofenceApiUrl` | Geofence backend |\n| `fetchRealTimeInAppApiUrl` | Real-time in-app |\n\n### 3.4 Optional feature flags\n\n| Property | Default | Effect |\n|----------|---------|--------|\n| `androidGeofenceEnabled` | `false` | When `true`, sets `INSTALL_DENGAGE_GEOFENCE=true` in `gradle.properties` and adds the geofence artifact to the app module’s `dependencies`. |\n| `androidHmsEnabled` | `false` | When `true`, registers HMS messaging in the manifest and passes Huawei-related parameters into native setup. Full AgConnect / HMS project setup may still require additional manual Gradle and console steps. |\n| `androidHuaweiIntegrationKey` | — | Used only when `androidHmsEnabled` is `true`. |\n| `androidDeviceConfiguration` | `\"Google\"` | `\"Google\"` or `\"Huawei\"` — passed through to native device configuration preference. |\n| `iosGeofenceEnabled` | `false` | When `true`, injects `ENV['install_dengage_geofence'] = '1'` into the generated **Podfile** so the geofence pod is installed on `pod install`. |\n| `iosAskNotificationPermission` | `true` | Controls whether the native startup path prompts for notification permission. |\n| `iosDevelopmentStatusFromBuild` | `true` | When `true`, the injected **AppDelegate** snippet sets development vs production mode from the build configuration (`DEBUG` vs release). Set `false` to force non-development behavior on iOS regardless of build type. |\n| `androidDevelopmentStatusFromBuild` | `true` (when injected) | Android `MainApplication` snippet uses `BuildConfig.DEBUG` for development status when enabled. |\n| `logEnabled` | `false` | Enables more verbose native logging where supported. |\n\nAuthoritative TypeScript shapes for all properties live in **`src/plugin/types.ts`** in the source repository (published as **`build/plugin/types.d.ts`**).\n\n### 3.5 Geofence — extra Expo configuration\n\nNative geofence modules require **location permission** strings on iOS. This plugin does **not** invent marketing copy for Apple’s required usage keys. Add them under Expo’s **`ios.infoPlist`**, for example:\n\n- `NSLocationWhenInUseUsageDescription`\n- `NSLocationAlwaysAndWhenInUseUsageDescription`\n\nIf you need **background** location updates, include **`location`** in **`UIBackgroundModes`** (alongside **`remote-notification`** if you already rely on it for push). Merge carefully with any other plugins that also modify `UIBackgroundModes`.\n\nOn Android, the geofence library contributes merged manifest permissions (fine / coarse / background location, boot completed, etc.). Runtime permission flows still apply on modern Android versions.\n\nGeofence can also be gated by **remote SDK configuration** from Dengage; enable the feature in the product console where applicable.\n\n---\n\n## 4. Prebuild and local runs\n\nApply the plugin whenever native projects are created or refreshed:\n\n```bash\nnpx expo prebuild --clean\n```\n\nThen build and install a dev client:\n\n```bash\nnpx expo run:ios\nnpx expo run:android\n```\n\n**EAS Build** runs an equivalent prebuild step for cloud builds according to your `eas.json` profile.\n\nAfter native generation, open the **`.xcworkspace`** under `ios/` (not the bare `.xcodeproj` alone) when working in Xcode.\n\n---\n\n## 5. Application code overview\n\nAfter **`expo prebuild`**, your app contains the **native** Dengage bootstrap code that this plugin generated (keys, URLs, FCM/HMS wiring, optional geofence binaries). None of that runs from JavaScript directly.\n\nYour **React / Expo JavaScript** talks to Dengage through **`@dengage-tech/react-native-dengage`**: a thin layer that reads **`NativeModules.DengageRN`** and exposes typed methods. Each method maps to a **native module method** (`@ReactMethod` on Android, `RCT_EXTERN_METHOD` on iOS) implemented in the same package’s `android/` and `ios/` sources. Those implementations call the **official Dengage Android / iOS SDKs** (`Dengage.*` on Android, `Dengage` / `DengageGeofence` on iOS).\n\nSo the chain is:\n\n**Your JS** → **`import Dengage from '@dengage-tech/react-native-dengage'`** → **`NativeModules.DengageRN`** → **native bridge (`ReactNativeDengageModule` / `ReactNativeDengage`)** → **Dengage native SDK** → **network / device / push / geofence**.\n\n---\n\n## 6. How `expo-dengage` and `@dengage-tech/react-native-dengage` work together (under the hood)\n\n### 6.1 Build-time (Expo config plugin)\n\nWhen you run **`expo prebuild`**, `@dengage-tech/expo-dengage` runs as an Expo **config plugin**. It does not ship JavaScript to your bundle; it **rewrites or generates native project files**:\n\n| Platform | What the plugin does (summary) |\n|----------|--------------------------------|\n| **Android** | Adds Google Services classpath and `apply plugin`; injects **`DengageRNCoordinator.sharedInstance.setupDengage(...)`** into `MainApplication` after `ApplicationLifecycleDispatcher.onApplicationCreate(this)` with your Firebase key, optional HMS, `enableGeoFence`, logging, and development flags; merges manifest meta-data for API URLs; registers **FCM** (and optionally **HMS**) `service` entries; adds a **`DengageExpoPushReceiver`** Kotlin stub for Dengage push intents; sets **`INSTALL_DENGAGE_GEOFENCE`** and **`sdk-geofence`** dependency when geofence is enabled. |\n| **iOS** | Writes Dengage URL keys into **`Info.plist`**; ensures **`UIBackgroundModes`** includes **`remote-notification`**; injects **`DengageRNCoordinator.staticInstance.setupDengage(...)`** into **`AppDelegate.swift`** (integration key, App Group, `launchOptions`, notification permission flag, **`enableGeoFence`**, logging, development status); adds **`UNUserNotificationCenterDelegate`** handling and **APNs token** forwarding; optionally prepends **`ENV['install_dengage_geofence'] = '1'`** to the **Podfile** so **`pod install`** pulls the **DengageGeofence** pod. |\n\nThat native bootstrap runs **once at app launch**, before React mounts. It initializes the underlying Dengage SDK with the same keys and options you declared in **`app.json`**.\n\n### 6.2 Run-time (React Native module)\n\nThe **`@dengage-tech/react-native-dengage`** package registers a native module named **`DengageRN`**. The default export in `src/index.tsx` is that module (or a **Proxy** that throws a helpful error if the native side is missing — e.g. in **Expo Go**).\n\nOn **module load**, the package may call **`registerNotificationListeners()`** once so that certain native → JS notification paths are wired without you having to call it (the method still exists for compatibility).\n\n### 6.3 Native SDK calls\n\nInside the bridge:\n\n- **Android** — `ReactNativeDengageModule.kt` methods call **`com.dengage.sdk.Dengage`** (and, when present, geofence classes via reflection).\n- **iOS** — `ReactNativeDengage.swift` calls **`Dengage`** / **`DengageGeofence`** (when the geofence pod is linked).\n\nSo **`expo-dengage`** ensures **init + manifest + Gradle/Pods** are correct; **`@dengage-tech/react-native-dengage`** ensures every **feature you invoke from JS** reaches those same native SDKs.\n\n### 6.4 Events from native to JavaScript (not the same as methods)\n\nSome behaviors are pushed **from native to JS** as **device events** (not return values of `Dengage.*` methods):\n\n| Event name | Typical source | How to listen in React Native |\n|------------|----------------|------------------------------|\n| **`onNotificationClicked`** | User taps a Dengage notification (Android receiver / iOS module) | `new NativeEventEmitter(NativeModules.DengageRN).addListener('onNotificationClicked', handler)` (iOS also declares this in **`supportedEvents`** on the native module). |\n| **`onNotificationReceived`** | Push received (Android **`NotifReciever`**) | Same pattern with **`NativeEventEmitter`** / **`DeviceEventEmitter`** depending on platform — use the event name your installed SDK version emits; payload is a serialized push **`Message`**. |\n| **`retrieveInAppLink`** | In-app link resolution (e.g. **`InAppLinkReceiver`** on Android, iOS **`supportedEvents`**) | Listen with **`NativeEventEmitter(NativeModules.DengageRN)`** for **`retrieveInAppLink`**. |\n\nPayload shapes match the native models (often JSON-like objects). Always guard listeners with cleanup on unmount.\n\n### 6.5 In-app inline and App Story (native UI components)\n\nBesides **`NativeModules.DengageRN`** methods, **`@dengage-tech/react-native-dengage`** registers **native view managers** you embed in JSX. They use the **same** native bootstrap and **`dengageInAppApiUrl`** (and related in-app setup) that **`expo-dengage`** applies at prebuild—there are **no extra Expo plugin keys** only for inline or App Story.\n\n#### In-app inline (`InAppInlineView`)\n\n**Purpose:** show a **Dengage inline placement** (banner / slot) at a fixed position in your layout, configured in the Dengage panel with a **property id**.\n\n**Requirements:**\n\n- Custom dev client or store build (not Expo Go).\n\n**Props (TypeScript):**\n\n| Prop | Type | Meaning |\n|------|------|--------|\n| **`propertyId`** | `string` | Inline property identifier from Dengage. |\n| **`screenName`** | `string` | Screen identifier supplied to the native view (use the value expected for your Dengage inline configuration). |\n| **`customParams`** | `Record<string, string>` | Extra targeting key-values for the placement. |\n| **`style`** | optional `ViewStyle` | Layout / size; the view defaults to full width. |\n\n**Example:**\n\n```tsx\nimport { InAppInlineView } from '@dengage-tech/react-native-dengage';\n\n<InAppInlineView\n  propertyId=\"YOUR_INLINE_PROPERTY_ID\"\n  screenName=\"home-inline\"\n  customParams={{ segment: 'vip' }}\n/>\n```\n\n#### App Story (`StoriesListView`)\n\n**Purpose:** render the **App Story** / stories strip UI driven by the native Dengage SDK (story property configured in the console).\n\n**Props:**\n\n| Prop | Type | Meaning |\n|------|------|--------|\n| **`storyPropertyId`** | `string \\| null` | Story property id from Dengage. |\n| **`screenName`** | `string \\| null` | Screen identifier supplied to the native story view (use the value expected for your Dengage App Story configuration). |\n| **`customParams`** | `Record<string, string> \\| null` | Optional targeting map. |\n| **`style`** | optional `ViewStyle` | Defaults include a minimum height and background in the component wrapper. |\n\n**Example:**\n\n```tsx\nimport { StoriesListView } from '@dengage-tech/react-native-dengage';\n\n<StoriesListView\n  storyPropertyId=\"YOUR_STORY_PROPERTY_ID\"\n  screenName=\"appstory\"\n  customParams={{}}\n/>\n```\n\n**Operational notes:** configure creatives and property ids in **Dengage**; wrong or missing **`propertyId` / `storyPropertyId`** results in an empty native view. Test on **real devices** after **`expo prebuild`** and a full native rebuild.\n\n---\n\n## 7. JavaScript API reference (`@dengage-tech/react-native-dengage`)\n\nImport the default export (typed as **`DengageType`**):\n\n```ts\nimport Dengage from '@dengage-tech/react-native-dengage';\n```\n\nBelow, **“native”** means the call is forwarded to **`DengageRN`** → Android/iOS bridge → **Dengage SDK**. Unless noted, methods are available on **both** platforms; some are **iOS-only** or **Android-only** as indicated.\n\n### 7.1 Push, tokens, and permissions\n\n| Method | What it does |\n|--------|----------------|\n| **`promptForPushNotifications()`** | Asks the user for notification permission (iOS path in native; Android uses activity-based permission request where applicable). |\n| **`promptForPushNotificationsWitCallback(callback)`** | Same intent as above with a **`(hasPermission: boolean) => void`** callback (**iOS**). |\n| **`registerForRemoteNotifications(enable: boolean)`** | Enables or disables registration for remote notifications (**iOS**). |\n| **`getUserPermission()`** | Returns a **promise of boolean** — whether the user has granted notification permission (reads from subscription / native state). |\n| **`setUserPermission(permission: boolean)`** | Sets user-level push permission flag in the SDK / subscription model. |\n| **`getToken()`** | Resolves to **string** — current push token from subscription (empty string if none). |\n| **`setToken(token: string)`** | Sets push token on the native side (advanced / testing scenarios). |\n| **`getSubscription()`** | Resolves to **Subscription** — device subscription snapshot (fields such as `sdkVersion`, `deviceId`, `contactKey`, `permission`, etc.). Primarily exercised on **Android**; on **iOS**, **`getContactKey()`** is often used for identity. |\n| **`resetAppBadge()`** | Clears the app icon badge count (**Android**). |\n| **`getLastPushPayload()`** | Resolves to **string** — last push payload serialized for debugging or deep-link handling. |\n\n### 7.2 Integration keys and logging (platform nuances)\n\n| Method | What it does |\n|--------|----------------|\n| **`setIntegrationKey(key: string)`** | Sets iOS integration key at runtime (**iOS**). Prefer configuring via **`expo-dengage`** so startup is consistent. |\n| **`getIntegrationKey()`** | Resolves to **string** — reads current iOS integration key (**iOS**). |\n| **`setFirebaseIntegrationKey(key: string)`** | **Android** — intended for compatibility; native init normally already set the key via **`setupDengage`**. May log a warning if the SDK is already initialized. |\n| **`setLogStatus(isVisible: boolean)`** | Toggles SDK log visibility on the native side. |\n| **`setDevelopmentStatus(isDebug: boolean)`** | Marks development vs production behavior for the native SDK (overrides / complements build-time flags where supported). |\n| **`getSdkParameters()`** | Resolves to **SdkParameters or null** — remote SDK configuration (e.g. feature flags such as geofence enabled server-side). |\n| **`getSdkVersion()`** | Resolves to **string** — native SDK version string. |\n\n### 7.3 Identity, device, and language\n\n| Method | What it does |\n|--------|----------------|\n| **`setContactKey(key: string \\| null)`** | Associates the device with a **contact key** in Dengage (CRM / user id). Pass **`null`** to clear. |\n| **`getContactKey()`** | Resolves to **string or null** — current contact key (**iOS** returns from native; **Android** often reads from **`getSubscription()`** in practice). |\n| **`getDeviceId()`** | Resolves to **string** — Dengage device identifier. |\n| **`setDeviceId(deviceId: string)`** | Overrides device id on the native side (use only when your integration requires it). |\n| **`setLanguage(language: string)`** | Sets language attribute used in segmentation / messaging. |\n| **`setPartnerDeviceId(adid: string)`** | Sets partner / advertising id (e.g. ADID) for attribution-style use cases. |\n\n### 7.4 Screen and navigation tracking\n\n| Method | What it does |\n|--------|----------------|\n| **`pageView(params: object)`** | Sends a **page view** / screen analytics event with arbitrary key-value **`params`** (e.g. `page_type`, `screen_name`). |\n| **`setNavigation()`** | Signals navigation stack reset / default navigation state to the SDK. |\n| **`setNavigationWithName(screenName: string)`** | Passes a screen name string to the native SDK. |\n| **`onMessageReceived(params: object)`** | Forwards a received message object into the native pipeline (advanced / FCM callback integration patterns). |\n\n### 7.5 Commerce and behavioral events (parameter objects)\n\nEach of the following accepts a **`params`** object (shape depends on your Dengage schema). They map to native **event** APIs for e‑commerce and engagement:\n\n| Method | Typical use |\n|--------|-------------|\n| **`addToCart(params)`** | Add line to cart. |\n| **`removeFromCart(params)`** | Remove line from cart. |\n| **`viewCart(params)`** | Cart screen viewed. |\n| **`beginCheckout(params)`** | Checkout started. |\n| **`placeOrder(params)`** | Order completed. |\n| **`cancelOrder(params)`** | Order cancelled. |\n| **`addToWishList(params)`** / **`removeFromWishList(params)`** | Wishlist mutations. |\n| **`search(params)`** | Search performed. |\n\n### 7.6 Custom and device events\n\n| Method | What it does |\n|--------|----------------|\n| **`sendDeviceEvent(tableName: string, data: object)`** | Sends a row-style **device event** to the table **`tableName`** with **`data`** fields. |\n| **`sendCustomEvent(eventTable: string, key: string, parameters: object)`** | Sends a **custom event** keyed by **`key`** into **`eventTable`** with **`parameters`**. |\n\n### 7.7 In-app messaging\n\nFor **embedded** placements (**in-app inline**) and the **App Story** strip, use the native views described in **section 6.5** in addition to the methods below.\n\n| Method | What it does |\n|--------|----------------|\n| **`registerInAppListener()`** | Registers the app to receive in-app message lifecycle callbacks on the native side. |\n| **`setInAppLinkConfiguration(deeplink: string)`** | Base deeplink or scheme configuration used when in-app actions open URLs. |\n| **`setInAppDeviceInfo(key: string, value: string)`** | Adds a key-value pair to in-app targeting context. |\n| **`clearInAppDeviceInfo()`** | Clears all in-app device info pairs. |\n| **`getInAppDeviceInfo()`** | Resolves to **record of string to string** — reads current in-app device info map. |\n| **`setCategoryPath(path: string)`** | Current category path for retail targeting. |\n| **`setCartItemCount(count: string)`** / **`setCartAmount(amount: string)`** | Lightweight cart hints as strings for in-app rules. |\n| **`setState(state: string)`** / **`setCity(city: string)`** | Geographic / regional hints for targeting. |\n| **`showRealTimeInApp(screenName: string, params: Record<string, string>)`** | Triggers a **real-time in-app** fetch/display path for **`screenName`** with extra **`params`**. |\n\n### 7.8 Cart object (structured)\n\n| Method | What it does |\n|--------|----------------|\n| **`setCart(cart: Cart)`** | Resolves to **boolean** — uploads a full structured **`Cart`** (items, totals, currency) to the SDK for in-app / personalization. |\n| **`getCart()`** | Resolves to **Cart** — reads the cart currently held by the native SDK. |\n\nTypes **`Cart`**, **`CartItem`**, etc. are exported from **`@dengage-tech/react-native-dengage`** (`./types`).\n\n### 7.9 Inbox\n\n| Method | What it does |\n|--------|----------------|\n| **`getInboxMessages(offset: number, limit: number)`** | Async — array of **`InboxMessage`** (paginated). |\n| **`deleteInboxMessage(id: string)`** | Async — **boolean** success for deleting one inbox message by id. |\n| **`setInboxMessageAsClicked(id: string)`** | Async — **boolean** success for marking a message as clicked. |\n| **`deleteAllInboxMessages()`** | Async — **boolean** success for clearing the inbox. |\n| **`setAllInboxMessageAsClicked()`** | Async — **boolean** success for marking all messages as clicked. |\n\n### 7.10 Geofence (requires native geofence enabled via this plugin)\n\n| Method | What it does |\n|--------|----------------|\n| **`requestLocationPermissions()`** | Starts the native flow to request location permissions (fine / background as configured on the OS). |\n| **`startGeofence()`** | Starts geofence tracking if native libraries are linked and server configuration allows it. |\n| **`stopGeofence()`** | Stops geofence tracking. |\n\nIf **`androidGeofenceEnabled`** / **`iosGeofenceEnabled`** are **`false`**, these calls may no-op or log warnings because the geofence native code is not linked.\n\n### 7.11 Notification action callback (iOS)\n\n| Method | What it does |\n|--------|----------------|\n| **`handleNotificationActionBlock(callback)`** | Registers a callback invoked with a **`NotificationAction`** shape when the user interacts with a notification (**iOS**). Use together with native notification delegate wiring from **`expo-dengage`**. |\n\n### 7.12 Deprecated / internal\n\n| Method | Notes |\n|--------|--------|\n| **`registerNotificationListeners()`** | Marked deprecated in types; the package may invoke it internally on load. **You normally do not call this** unless directed by Dengage support. |\n\n---\n\n## 8. Sample project layout\n\nA separate **sample Expo application** maintained alongside this plugin demonstrates a full `app.json` plugin block, navigation, **`pageView`**, **`NativeEventEmitter`** listeners, and optional screens including **push**, **inbox**, **in-app message**, **in-app inline** (`InAppInlineView`), **App Story** (`StoriesListView`), and **geofence**. Use it as a structural reference; cross-check property ids and parameter shapes with your Dengage project documentation.\n\n---\n\n## 9. Troubleshooting\n\n| Symptom | What to verify |\n|---------|----------------|\n| Missing native module / crash inside Expo Go | Use a **custom dev build** or EAS build — not Expo Go. |\n| **`The package '@dengage-tech/react-native-dengage' doesn't seem to be linked`** | Run **`pod install`**, rebuild after **`expo prebuild`**, and ensure you are not on Expo Go. |\n| Android FCM not delivering | `google-services.json` path, `expo.android.package` vs Firebase package, release SHA keys if applicable. |\n| iOS push not registering | Capabilities, provisioning profiles, App Group, correct integration key, physical device for final push tests. |\n| Plugin edits not visible | Run **`npx expo prebuild --clean`**, reinstall pods on iOS, clean Gradle on Android, rebuild. |\n| Coexisting push libraries | If you use another push or notification library, confirm only one component owns FCM message handling or coordinate forwarding explicitly with your integration team. |\n\n---\n\n## 10. Release checklist (Expo + Dengage)\n\n1. [ ] Install **`@dengage-tech/expo-dengage`** and **`@dengage-tech/react-native-dengage`** (and other **`peerDependencies`**) at supported versions.\n2. [ ] Add the plugin block with **Android Firebase** and **iOS** integration keys and **`iosAppGroup`**.\n3. [ ] Configure **`expo.android.googleServicesFile`** and matching **`expo.android.package`**.\n4. [ ] Set optional URL overrides from Dengage for your environment.\n5. [ ] Enable **`androidGeofenceEnabled`** / **`iosGeofenceEnabled`** only if geofence is required; add iOS location usage strings and background modes as needed.\n6. [ ] Run **`npx expo prebuild --clean`**, then **`pod install`** under `ios/` if you manage CocoaPods manually.\n7. [ ] Produce dev or store builds with **`expo run:*`** or **EAS Build**; validate push, in-app, and analytics on real devices.\n8. [ ] Implement **`pageView`**, commerce events, inbox, **in-app inline** / **App Story** views, and listeners as required; test against staging before production keys.\n\n---\n\n## 11. Support\n\nFor **config-plugin** behavior (Gradle, Podfile, `Info.plist`, manifests), inspect **`src/plugin/`** in **`@dengage-tech/expo-dengage`** or open an issue with **Expo SDK version**, **plugin version**, and a redacted **`app.json`** plugin block.\n\nFor **JavaScript API** semantics, payload schemas, and campaign rules, use **Dengage** product documentation and your integration manager.\n\n---\n\n## Limitations\n\n- **Expo Go** does not include this native setup. Use **EAS Build**, **`expo run:ios`**, **`expo run:android`**, or another **custom development client**.\n- If you combine Dengage with other libraries that own FCM or notification delivery, plan ownership and forwarding with your team before production.\n","readmeFilename":"README.md"}