npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pushwoosh-react-native-plugin

v7.0.8

Published

This plugin allows you to send and receive push notifications. Powered by Pushwoosh (www.pushwoosh.com).

Readme

Table of Contents

Documentation

Features

  • Push Notifications — register, receive, and handle push notifications on iOS and Android
  • In-App Messages — trigger and display in-app messages based on events
  • Inline In-App Banners — In-App banners inside the app's own screens, drawn by the SDK or by the app
  • Tags & Segmentation — set and get user tags for targeted messaging
  • User Identification — associate devices with user IDs for cross-device tracking
  • Message Inbox — built-in UI for message inbox with customization options
  • Badge Management — set, get, and increment app icon badge numbers
  • Local Notifications — schedule and manage local notifications
  • Rich Media — modal and legacy Rich Media presentation styles
  • Huawei Push — HMS push notification support
  • Multi-channel — email, SMS, and WhatsApp registration
  • TypeScript Support — full TypeScript definitions included

Installation

npm install pushwoosh-react-native-plugin --save

iOS Setup

cd ios && pod install

That is the whole iOS setup for the app target. The native Pushwoosh SDK comes from the CocoaPods trunk pods PushwooshXCFramework and its PushwooshInboxKit subspec, so upgrading the plugin needs nothing but pod install. The plugin requires iOS 15 or newer.

Breaking changes when upgrading from an earlier plugin version.

  • The plugin requires iOS 15 or newer. If your app targets a lower version (the default of some React Native versions, for example 13.4 in the 0.74 and 0.75 templates), raise platform :ios in the Podfile and the iOS deployment target of the app to 15.0, or pod install fails.
  • If you added PushwooshInboxBundle.bundle to the Xcode project by hand (the old Message Inbox instructions), remove that reference: the Inbox no longer uses it, and the script add_inbox_ios_resources.js no longer exists.
  • On the trunk pods, an app extension whose target uses pod 'PushwooshXCFramework' must also take pod 'PushwooshXCFramework/PushwooshInboxKit', see Notification Service Extension.

CocoaPods trunk becomes read-only on December 2, 2026. From then on the native SDK gets no updates through pods: the plugin keeps building on the last version published there, and new native releases come only as the Swift package Pushwoosh-XCFramework. On React Native 0.75 or newer pod install prints a warning about it until the app moves to the package, see Moving to the Swift package. React Native 0.74 cannot take Swift packages through CocoaPods and stays on the trunk pods.

Moving to the Swift package

Recommended on React Native 0.75 or newer (the sample and CI run 0.87), before December 2026. With the package the app gets the native SDK version each plugin release pins, also after trunk freezes. If you do not move, nothing breaks: the app keeps building on the trunk pods, but its native SDK stays at the last version published to trunk.

  1. Load the plugin's Podfile helper at the top of ios/Podfile and call it after react_native_post_install:

    # Resolve the Pushwoosh Podfile helper with node as well, so a hoisted node_modules works too
    require Pod::Executable.execute_command('node', ['-p',
      'require.resolve(
        "pushwoosh-react-native-plugin/scripts/pushwoosh-spm.rb",
        {paths: [process.argv[1]]},
      )', __dir__]).strip
    
    post_install do |installer|
      react_native_post_install(installer, config[:reactNativePath], :mac_catalyst_enabled => false)
      pushwoosh_spm_post_install(installer)
    end

    The require has to stay at the top level of the Podfile, before the targets: the plugin switches to the package when pod install reads its podspec, and it checks for the helper at that moment. A require inside post_install comes too late, and the app stays on the trunk pods. With the plugin in a plain <app>/node_modules the shorter require_relative '../node_modules/pushwoosh-react-native-plugin/scripts/pushwoosh-spm' does the same job.

  2. If the project has a Notification Service Extension, pass its target name: pushwoosh_spm_post_install(installer, extra_targets: ['NotificationService']). The same goes for any other target that references the SDK's classes directly, such as a unit-test bundle that mocks them.

  3. Remove every pod 'PushwooshXCFramework' line (and any pod 'PushwooshXCFramework/...' subspec line) from the Podfile, in all targets. A trunk pod next to the package puts a second copy of the native SDK into the app: pod install warns about it, and the build fails with Multiple commands produce .../PushwooshFramework.framework.

  4. Run pod install and build. The December warning is gone, and Podfile.lock no longer lists PushwooshXCFramework.

The helper adds the package, at the version the plugin pins, and its PushwooshFramework, PushwooshCore, PushwooshBridge and PushwooshInboxKit products to every app target that links the plugin. With in_app: true it also adds PushwooshInApp, to the app targets only. Running pod install again changes nothing, and on React Native below 0.75 the helper does nothing at all. Both static (the default) and dynamic (USE_FRAMEWORKS=dynamic) linking work.

A notice you can ignore. With the helper, pod install prints React Native's own Pod pushwoosh-react-native-plugin is using swift package(s) ... with static linking, this might cause linker errors: it is expected, the helper is exactly what makes static linking work.

First build. Resolving the package needs network access; without it Xcode stops with a package resolution error. On a cold package cache the first resolve can fail with already exists in file system while two projects fetch the package's binaries at once: run the build (or pod install) again.

Expo. expo prebuild regenerates ios/Podfile, and its output does not show the pod install warning. Without changes a managed Expo project builds on the trunk pods. To move it to the package, turn on ios.useSwiftPackage of the Pushwoosh Expo config plugin (pushwoosh-expo-plugin newer than 2.0.7): prebuild then writes the helper lines into the generated Podfile, see iOS: Swift package. A project that keeps the generated ios/ directory checked in can edit its Podfile as above instead.

Message Inbox UI. On iOS presentInboxUI() shows the Inbox screen of the native SDK (InboxKit), on the package and on the trunk pods alike, see Message Inbox.

In-App messages and inline banners (optional). The In-App module, which also carries the inline banners, is not linked by default. To add it, pass in_app: true to the helper: pushwoosh_spm_post_install(installer, in_app: true) (it works together with extra_targets). It is linked into the app targets only, not into extensions. Remove the flag and run pod install to take it out again. In-App and inline banners on iOS are available only through the Swift package (React Native 0.75+ with the helper); CocoaPods is not supported.

Notification Service Extension

Add a Notification Service Extension to track message delivery and show media attachments on iOS: follow the native guide.

The extension runs as a separate process and does not see the application code passed to Pushwoosh.init(). Give it the code in one of two ways:

  • Pushwoosh_APPID in the app's Info.plist. The extension inherits it from the app, there is no need to repeat it in the extension's Info.plist. With plugin versions older than 6.1.59 (iOS SDK before 7.1.0) add it to the extension's Info.plist as well.
  • An App Group shared by the app and the extension. Add the same App Group to both targets (Signing & Capabilities > App Groups) and set PW_APP_GROUPS_NAME to its identifier in both Info.plist files. The extension then reads the application code the app stored there. The App Group is also needed to keep the badge in sync, and for the extension to reach a reverse proxy set with setReverseProxy().

Without the application code the extension sends no delivery event, and with older iOS SDK versions every notification is shown only after about 30 seconds, when the extension times out.

On the trunk pods the extension takes the SDK through a pod 'PushwooshXCFramework' line in its Podfile target. That target must also contain pod 'PushwooshXCFramework/PushwooshInboxKit': the plugin takes the Inbox through that subspec, and when the subspec sets differ CocoaPods builds two variants of the framework and the build fails with Multiple commands produce ... PushwooshFramework.framework. After moving to the Swift package it takes the same package instead: pass its target name to the helper, pushwoosh_spm_post_install(installer, extra_targets: ['NotificationService']), or add the package to that target in Xcode. Its version has to match the plugin's, otherwise the package resolution fails with a version conflict.

Android Setup (Firebase Cloud Messaging)

Push notifications on Android require Firebase Cloud Messaging (FCM).

Option A — Android Studio (recommended): Open the android/ folder in Android Studio, then go to Tools > Firebase > Cloud Messaging > Set up Firebase Cloud Messaging. The wizard will automatically add all required configuration.

Option B — Manual setup:

  1. Create a project in Firebase Console
  2. Download google-services.json and place it in android/app/
  3. Add the Google Services classpath to android/build.gradle:
    classpath("com.google.gms:google-services:4.3.15")
  4. Apply the plugin in android/app/build.gradle:
    apply plugin: "com.google.gms.google-services"

The Pushwoosh plugin already includes the firebase-messaging dependency, so you do not need to add it manually.

The plugin also includes pushwoosh-inapp-ui, which draws the inline banners. It turns on Native In-App messages as well: Android now shows the Native In-App messages the server sends, which earlier versions of the plugin skipped with module is not connected, skipping.

React Native versions and the New Architecture

The plugin is a Turbo Native Module and also works on the legacy bridge. One package covers both:

| React Native | Architecture | How the plugin runs | |---|---|---| | 0.74 – 0.81, newArchEnabled=false (default) | Legacy bridge | Bridge module | | 0.74 – 0.81, newArchEnabled=true / RCT_NEW_ARCH_ENABLED=1 | New Architecture | Codegen TurboModule | | 0.82 and later | New Architecture only (bridgeless) | Codegen TurboModule |

No interop layer is involved on the New Architecture. Events keep their API on both architectures:

import { DeviceEventEmitter } from 'react-native';

DeviceEventEmitter.addListener('pushOpened', (push) => { /* ... */ });
DeviceEventEmitter.addListener('pushReceived', (push) => { /* ... */ });

presentInboxUI() presents a native screen (a view controller on iOS, an Activity on Android) outside the React view tree, so it does not depend on Fabric. React Native below 0.74 is supported by plugin versions 6.1.x.

Both setups ship as samples with identical screens: example/demoapp (React Native 0.87, New Architecture) and example/demoapp-legacy (React Native 0.74, legacy architecture).

AI-Assisted Integration

Integrate the Pushwoosh React Native plugin using AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.).

Requirement: Your AI assistant must have access to Context7 MCP server or web search capabilities.

Quick Start Prompts

Choose the prompt that matches your task:


1. Basic Plugin Integration

Integrate Pushwoosh React Native plugin into my React Native project.

Requirements:
- Install pushwoosh-react-native-plugin via npm
- Initialize Pushwoosh with my App ID in the app entry point
- Register for push notifications and handle pushOpened events via DeviceEventEmitter

Use Context7 MCP to fetch Pushwoosh React Native plugin documentation.

2. Tags and User Segmentation

Show me how to use Pushwoosh tags in a React Native app for user segmentation.
I need to set tags, get tags, and set user ID for cross-device tracking.

Use Context7 MCP to fetch Pushwoosh React Native plugin documentation for setTags and getTags.

3. Message Inbox Integration

Integrate Pushwoosh Message Inbox into my React Native app. Show me how to:
- Display the inbox UI with custom styling
- Load messages programmatically
- Track unread message count

Use Context7 MCP to fetch Pushwoosh React Native plugin documentation for presentInboxUI.

Quick Start

1. Initialize the Plugin

import Pushwoosh from 'pushwoosh-react-native-plugin';
import { DeviceEventEmitter } from 'react-native';

// Listen for push notification events
DeviceEventEmitter.addListener('pushOpened', (e) => {
    console.log("Push opened: " + JSON.stringify(e));
});

// Initialize Pushwoosh
Pushwoosh.init({
    pw_appid: "YOUR_PUSHWOOSH_APP_ID"
});

// Register for push notifications
Pushwoosh.register(
    (token) => {
        console.log("Registered with push token: " + token);
    },
    (error) => {
        console.error("Failed to register: " + error);
    }
);

2. Set User Tags

import Pushwoosh from 'pushwoosh-react-native-plugin';

Pushwoosh.setTags(
    { username: "john_doe", age: 25, interests: ["sports", "tech"] },
    () => console.log("Tags set successfully"),
    (error) => console.error("Failed to set tags: " + error)
);

Pushwoosh.getTags(
    (tags) => console.log("Tags: " + JSON.stringify(tags)),
    (error) => console.error("Get tags error: " + error)
);

3. Post Events for In-App Messages

import Pushwoosh from 'pushwoosh-react-native-plugin';

Pushwoosh.setUserId("user_12345");
Pushwoosh.postEvent("purchase_complete", {
    productName: "Premium Plan",
    amount: "9.99"
});

4. Message Inbox

import Pushwoosh from 'pushwoosh-react-native-plugin';
import { processColor, Image, DeviceEventEmitter } from 'react-native';

// Open inbox UI with custom styling
Pushwoosh.presentInboxUI({
    dateFormat: "dd.MM.yyyy",
    accentColor: processColor('#3498db'),
    backgroundColor: processColor('#ffffff'),
    titleColor: processColor('#333333'),
    descriptionColor: processColor('#666666'),
    listEmptyMessage: "No messages yet"
});

// iOS only: an extra style key and the tap event
Pushwoosh.presentInboxUI({ barTitle: "Messages", handleMessageTap: true });
DeviceEventEmitter.addListener('inboxMessageTap', (message) => {
    console.log("Tapped: " + message.title, message.tappedButton);
});

// Inbox tabs configured on the server, without "All"
Pushwoosh.getTabs().then((tabs) => tabs.forEach((t) => console.log(t.id + ": " + t.title)));

// Or load messages programmatically
Pushwoosh.loadMessages(
    (messages) => {
        messages.forEach((msg) => {
            console.log(msg.title + ": " + msg.message);
        });
    },
    (error) => console.error("Failed to load: " + error)
);

Pushwoosh.unreadMessagesCount((count) => {
    console.log("Unread messages: " + count);
});

On iOS the Inbox is a native InboxKit screen (iOS 15 or newer): the title comes from barTitle ("Inbox" if not set), the system close button sits on the right, and a second presentInboxUI() call while the Inbox is shown is ignored. Colors are numbers from processColor, images are Image.resolveAssetSource(...) objects. A key that is not set keeps the default.

| Style keys | iOS | Android | |---|---|---| | dateFormat, listEmptyMessage, listErrorMessage, accentColor, backgroundColor, titleColor, descriptionColor, dateColor, defaultImageIcon, barBackgroundColor, barAccentColor, barTextColor | yes (defaultImageIcon is the card image placeholder) | yes | | defaultTextColor | yes (iOS only: the title and description color when titleColor / descriptionColor are not set) | not supported | | highlightColor, dividerColor, listEmptyImage, listErrorImage | not supported on iOS | yes | | unreadImage | not supported on iOS | not supported | | readTitleColor, readDescriptionColor, readDateColor | ignored (Android only) | yes | | swipeToDeleteEnabled, automaticReadOnDisplay, automaticReadOnDisappear, enableDarkTheme, pinningEnabled, pinIndicatorVisible, pinIndicatorColor, pinIndicatorImage, inlineButtonsEnabled, buttonTextColor, buttonBackgroundColor, buttonFontSize, buttonCornerRadius, handleMessageTap, barTitle | yes (iOS only) | not supported |

  • Dark theme (iOS). With no style the Inbox follows the system theme. Any of the card colors backgroundColor, titleColor, descriptionColor, dateColor, defaultTextColor without enableDarkTheme keeps the Inbox light. enableDarkTheme set to true or false always wins. With a dark backgroundColor also set a light barTextColor or a light barBackgroundColor, otherwise the Inbox title is not visible.
  • Read state (iOS). Messages that are shown are marked as read: automaticReadOnDisplay is on by default.
  • Taps (iOS). handleMessageTap: true makes the SDK skip its own action for a tap on a card or on a button. The inboxMessageTap event is sent for every card and button tap regardless of the flag. Its payload is the message as loadMessages returns it, plus tappedButton ({ title, action, url?, payload? }, action is openURL, dismiss, markRead or custom) when a button was tapped. With handleMessageTap: true a tap on a card or on any of its buttons still marks the message as read, and the event still comes. A tap on a video preview plays the video and sends no event when the message has no link or rich media of its own; on a message with a link or rich media it is a tap on the card: the event is sent and handleMessageTap applies.
  • Tabs. getTabs() returns a Promise of { id, title } objects in server order, without the "All" tab, and [] when there are none. On iOS the tabs come with the Swift package (native iOS SDK 7.3 or newer); with the CocoaPods trunk pods (native iOS SDK 7.2.8) iOS returns an empty array. Tabs reflect the last Inbox load.

5. Multi-channel Communication

import Pushwoosh from 'pushwoosh-react-native-plugin';

Pushwoosh.setEmails(
    ["[email protected]"],
    () => console.log("Email set"),
    (error) => console.error(error)
);

Pushwoosh.registerSMSNumber("+1234567890");
Pushwoosh.registerWhatsappNumber("+1234567890");

6. Custom Notification Handling (iOS)

import Pushwoosh from 'pushwoosh-react-native-plugin';

Pushwoosh.init({
    pw_appid: "YOUR_PUSHWOOSH_APP_ID",
    pw_notification_handling: "CUSTOM"
});

7. Inline In-App Banners

Inline banners are In-App banners shown inside a screen of the app, in a slot set up in the Pushwoosh Control Panel. They come from their own entry point, pushwoosh-react-native-plugin/inline.

Setup. Android needs nothing. On iOS inline banners are part of the In-App module: React Native 0.75+ on the Swift package with pushwoosh_spm_post_install(installer, in_app: true). Without the module, and on the CocoaPods trunk pods (native iOS SDK 7.2.8, also React Native 0.74), the app builds and runs as before: the slot component stays empty at zero height and requestSlots rejects with code 0.

Slot component. The native SDK requests the slot's banner, draws it and reports its shows, clicks and dismissals by itself:

import { ScrollView } from 'react-native';
import { PushwooshInlineSlot } from 'pushwoosh-react-native-plugin/inline';

const Home = () => (
    <ScrollView>
        <PushwooshInlineSlot slotId="home_top" />
        {/* the rest of the screen */}
    </ScrollView>
);

The component takes the width its parent gives it and the height of the banner: it grows to the banner with an animation (none when the user turned on Reduce Motion), and an empty slot takes no space. It accepts the View props such as style and testID, but no children.

A banner counts as shown when at least half of it stays on screen for 0.3 seconds. The SDK takes into account scroll views and overflow: 'hidden' views around the slot (a banner scrolled out of view is not counted), screens pushed over it by a native navigator (React Navigation native stack, bottom tabs) and a React Native <Modal>. It does not see views drawn by JavaScript over the slot: a position: 'absolute' view, a JavaScript bottom sheet or a transparent screen of a JavaScript navigator. A banner under them counts as shown.

Own rendering. To draw a banner yourself, request the slot, read the banner as data and report what happened to it:

import { PushwooshInline, PushwooshInlineError } from 'pushwoosh-react-native-plugin/inline';

try {
    await PushwooshInline.requestSlots(['home_top', 'cart']);
} catch (error) {
    if (error instanceof PushwooshInlineError && error.code === PushwooshInlineError.RATE_LIMITED) {
        // the slots keep the banners they have
    }
}

const banner = await PushwooshInline.banner('cart'); // null when the slot is empty
if (banner) {
    // draw banner.payload, then report it
    PushwooshInline.trackShown(banner.slotId, banner.bannerId);
    PushwooshInline.trackClick(banner.slotId, banner.bannerId, 'buy_button'); // elementId is optional
    PushwooshInline.dismiss(banner.slotId, banner.bannerId);
}

The request limits and display rules are those of the native SDKs; the plugin neither repeats nor bypasses them. A banner is the same object on iOS and Android:

| Field | Type | Description | |-------|------|-------------| | slotId | string | The slot the banner is in | | bannerId | string | The banner | | version | number | Grows every time the banner content changes | | format | string | 'native' or 'html' | | html | string \| null | The HTML document of an 'html' banner | | payload | Record<string, string> | Campaign data set in the Control Panel; only string values are kept | | expireDate | Date \| null | When the banner stops being shown; null = never | | isTest | boolean | A draft sent to a test device; its events are not counted in campaign statistics |

Errors. requestSlots rejects with a PushwooshInlineError whose code is the same on both platforms:

| Code | Constant | Meaning | |------|----------|---------| | 0 | OTHER | Any other failure: no network, a server or HTTP error. On iOS also the In-App module not linked (com.pushwoosh.module -1) or a native SDK without inline banners (trunk pods). On iOS the message starts with the native error domain and code | | 1 | INVALID_ARGUMENT | No slot ids left after dropping empty ones and duplicates, or more than 10 slots in one request | | 2 | ENDPOINT_UNAVAILABLE | No inline banners endpoint can be resolved (a reverse proxy without the device API path) | | 3 | RATE_LIMITED | Too many manual requests: 5 per session, then one per 3 minutes | | 4 | INVALID_RESPONSE | The server answered without slots | | 5 | OWNER_CHANGED | A user change is not confirmed by the server yet, or the user or the app changed during the request |

iOS errors of the com.pushwoosh.inline domain map to 1-5 one to one, Android PushwooshInlineException codes are 0-5.

Events. The slot events come for the slot component and for own rendering alike:

const subscription = PushwooshInline.onSlotClicked(({ slotId, banner, elementId }) => {
    console.log(`${slotId}: ${banner.bannerId} tapped at ${elementId ?? 'the banner'}`);
});
// later
subscription.remove();

| Method | Fired when | |--------|------------| | onSlotUpdated | The slot changed: a new banner (banner) or the slot became empty (banner is null). A slot that was empty and stays empty after a request sends nothing, as in the native SDKs | | onSlotShown | The banner was counted as shown | | onSlotClicked | The user tapped the banner; elementId is the tapped element, null for the banner itself | | onSlotDismissed | The banner was closed |

The plugin takes the native inline delegate (iOS) and listener (Android) in Pushwoosh.init(). An app that sets its own native inline delegate or listener replaces the plugin's, and the JavaScript events stop.

Theme. PushwooshInline.setColorScheme('app' | 'system' | 'light' | 'dark') sets one theme for all slots, getColorScheme() reads it. The default 'app' follows the theme of the app window, the one Appearance.setColorScheme() sets. A theme kept only in JavaScript (for example a React Navigation theme without Appearance) is not visible to the native SDK: pass 'light' or 'dark' then. 'system' follows the phone setting.

API Reference

Initialization & Registration

| Method | Description | |--------|-------------| | init(config, success?, fail?) | Initialize the plugin. Call on every app launch | | register(success?, fail?) | Register for push notifications | | unregister(success?, fail?) | Unregister from push notifications | | getPushToken(success) | Get the push token | | getHwid(success) | Get Pushwoosh Hardware ID | | getUserId(success) | Get current user ID |

Tags & User Data

| Method | Description | |--------|-------------| | setTags(tags, success?, fail?) | Set device tags | | getTags(success, fail?) | Get device tags | | setUserId(userId, success?, fail?) | Set user identifier for cross-device tracking | | setLanguage(language) | Set custom language for localized pushes | | setEmails(emails, success?, fail?) | Register emails for the user | | setUserEmails(userId, emails, success?, fail?) | Set user ID and register emails | | registerSMSNumber(phoneNumber) | Register SMS number (E.164 format) | | registerWhatsappNumber(phoneNumber) | Register WhatsApp number (E.164 format) |

Notifications

| Method | Description | |--------|-------------| | createLocalNotification(config) | Schedule a local notification | | clearLocalNotification() | Clear all pending local notifications | | clearNotificationCenter() | Clear all notifications from notification center |

Badge Management

| Method | Description | |--------|-------------| | setApplicationIconBadgeNumber(badge) | Set badge number | | getApplicationIconBadgeNumber(callback) | Get current badge number | | addToApplicationIconBadgeNumber(badge) | Increment/decrement badge |

In-App Messages & Events

| Method | Description | |--------|-------------| | postEvent(event, attributes?) | Post event to trigger In-App Messages | | setRichMediaType(type) | Set Rich Media style (MODAL or LEGACY) | | getRichMediaType(callback) | Get current Rich Media style |

Inline In-App Banners

From pushwoosh-react-native-plugin/inline, see Inline In-App Banners.

| Member | Description | |--------|-------------| | <PushwooshInlineSlot slotId /> | Slot component: the native SDK requests, draws and reports the banner | | PushwooshInline.requestSlots(slotIds) | Promise; requests the banners of up to 10 slots, rejects with PushwooshInlineError | | PushwooshInline.banner(slotId) | Promise of the slot's banner, null when it is empty | | PushwooshInline.trackShown(slotId, bannerId) | Report a show of a banner the app draws itself | | PushwooshInline.trackClick(slotId, bannerId, elementId?) | Report a click | | PushwooshInline.dismiss(slotId, bannerId) | Close the banner | | PushwooshInline.setColorScheme(scheme) / getColorScheme() | Theme of all slots: 'app', 'system', 'light', 'dark' | | PushwooshInline.onSlotUpdated/onSlotShown/onSlotClicked/onSlotDismissed(listener) | Slot events; return a subscription with remove() |

Message Inbox

| Method | Description | |--------|-------------| | presentInboxUI(style?) | Open inbox UI with optional style customization | | getTabs() | Promise of the Inbox tabs, { id, title }, without "All" | | loadMessages(success, fail?) | Load inbox messages programmatically | | unreadMessagesCount(callback) | Get unread message count | | messagesCount(callback) | Get total message count | | messagesWithNoActionPerformedCount(callback) | Get messages with no action count | | readMessage(id) | Mark message as read | | readMessages(ids) | Mark multiple messages as read | | deleteMessage(id) | Delete a message | | deleteMessages(ids) | Delete multiple messages | | performAction(id) | Perform the action associated with a message |

Android-specific

| Method | Description | |--------|-------------| | setMultiNotificationMode(on) | Allow multiple notifications in notification center | | setLightScreenOnNotification(on) | Turn screen on when notification arrives | | setEnableLED(on) | Enable LED blinking on notification | | setColorLED(color) | Set LED color (ARGB integer) | | setSoundType(type) | Set sound type (0=default, 1=none, 2=always) | | setVibrateType(type) | Set vibration type (0=default, 1=none, 2=always) | | setNotificationIconBackgroundColor(color) | Set notification icon background color | | enableHuaweiPushNotifications() | Enable Huawei HMS push support |

Communication Control

| Method | Description | |--------|-------------| | setCommunicationEnabled(enable, success?, fail?) | Enable/disable all Pushwoosh communication | | isCommunicationEnabled(success) | Check if communication is enabled |

Reverse Proxy

| Method | Description | |--------|-------------| | setReverseProxy(url, headers?) | Route all SDK requests through a reverse proxy. Call before init() |

Events (DeviceEventEmitter)

| Event | Description | |-------|-------------| | pushOpened | Fired when a notification is opened by the user | | pushReceived | Fired when a notification is received | | inboxMessageTap | (iOS) Fired when the user taps an Inbox card or one of its buttons (a video preview counts as a card tap only on a message with a link or rich media; otherwise it plays the video); payload is the message plus an optional tappedButton |

Support

License

Pushwoosh React Native Plugin is available under the MIT license. See LICENSE for details.


Made with ❤️ by Pushwoosh