/**
 * Failed to minify the file using Terser v5.39.0. Serving the original version.
 * Original file: /npm/pushwoosh-react-native-plugin@6.1.57/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
'use strict';

/**
 * @fileoverview Pushwoosh React Native Plugin - Integration Guide
 *
 * @description
 * Pushwoosh is a customer engagement platform for push notifications, in-app messages,
 * emails, SMS, and WhatsApp. This React Native plugin wraps native iOS and Android
 * Pushwoosh SDKs and provides a JavaScript bridge for hybrid mobile applications.
 *
 * @section Installation
 *
 * ```bash
 * npm install pushwoosh-react-native-plugin --save
 * cd ios && pod install
 * ```
 *
 * @section Android Setup (Firebase Cloud Messaging)
 *
 * Push notifications on Android require Firebase Cloud Messaging (FCM).
 * Add Firebase to your Android project using one of the following methods:
 *
 * 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 the Firebase Console (https://console.firebase.google.com)
 *   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.
 *
 * For more details, see: https://firebase.google.com/docs/android/setup
 *
 * @section Quick Start
 *
 * Step 1: Initialize the plugin and register for push notifications
 *
 * ```javascript
 * 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: "XXXXX-XXXXX"
 * });
 *
 * // Register for push notifications
 * Pushwoosh.register(
 *     (token) => {
 *         console.log("Registered with push token: " + token);
 *     },
 *     (error) => {
 *         console.error("Failed to register: " + error);
 *     }
 * );
 * ```
 *
 * @section Common Use Cases
 *
 * User identification and cross-device tracking:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * // After user login
 * Pushwoosh.setUserId("user_12345");
 * Pushwoosh.setEmails(["user@example.com"]);
 * ```
 *
 * User segmentation with tags:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * Pushwoosh.setTags(
 *     { subscription: "premium", age: 25, interests: ["sports", "music"] },
 *     () => 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)
 * );
 * ```
 *
 * Trigger In-App Messages with events:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * Pushwoosh.setUserId("user_12345");
 * Pushwoosh.postEvent("purchase_complete", {
 *     productName: "Premium Plan",
 *     amount: "9.99"
 * });
 * ```
 *
 * Schedule a local notification:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * Pushwoosh.createLocalNotification({
 *     msg: "Your order is ready!",
 *     seconds: 60,
 *     userData: { orderId: "12345" }
 * });
 * ```
 *
 * Message Inbox with custom styling:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 * import { processColor } from 'react-native';
 *
 * Pushwoosh.presentInboxUI({
 *     dateFormat: "dd.MM.yyyy",
 *     accentColor: processColor('#3498db'),
 *     backgroundColor: processColor('#ffffff'),
 *     titleColor: processColor('#333333'),
 *     descriptionColor: processColor('#666666'),
 *     listEmptyMessage: "No messages yet"
 * });
 *
 * // 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);
 * });
 * ```
 *
 * Multi-channel communication:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * Pushwoosh.setEmails(["user@example.com"]);
 * Pushwoosh.registerSMSNumber("+1234567890");
 * Pushwoosh.registerWhatsappNumber("+1234567890");
 * ```
 *
 * Enable/disable Pushwoosh communication (e.g. for GDPR):
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * // User opted out
 * Pushwoosh.setCommunicationEnabled(false);
 *
 * // User opted in
 * Pushwoosh.setCommunicationEnabled(true);
 *
 * // Check current status
 * Pushwoosh.isCommunicationEnabled((enabled) => {
 *     console.log("Communication enabled: " + enabled);
 * });
 * ```
 *
 * Custom notification handling on iOS:
 *
 * ```javascript
 * import Pushwoosh from 'pushwoosh-react-native-plugin';
 *
 * Pushwoosh.init({
 *     pw_appid: "XXXXX-XXXXX",
 *     pw_notification_handling: "CUSTOM"
 * });
 * ```
 *
 * @section Configuration Parameters
 *
 * - pw_appid (required) - Pushwoosh Application ID from Control Panel
 * - pw_notification_handling (optional, iOS) - Set to "CUSTOM" for custom notification handling
 *
 * @section Events (DeviceEventEmitter)
 *
 * - "pushOpened" - Fired when a notification is opened by the user.
 * - "pushReceived" - Fired when a notification is received.
 *
 * @module pushwoosh-react-native-plugin
 */

import { NativeModules } from 'react-native';

const PushwooshModule = NativeModules.Pushwoosh;

//Constant: RichMediaStyle
//Rich Media presentation style constants.
//
//Values:
// MODAL - Rich Media displayed as modal dialog
// LEGACY - Rich Media displayed as full-screen activity
//
//Example:
//(start code)
//	Pushwoosh.setRichMediaType(Pushwoosh.RichMediaStyle.MODAL);
//(end)
const RichMediaStyle = {
	MODAL: 0,
	LEGACY: 1
};

/**
 * PushNotification class provides the JavaScript API for interacting with the Pushwoosh SDK.
 * Import it via: `import Pushwoosh from 'pushwoosh-react-native-plugin';`
 *
 * @class PushNotification
 */
class PushNotification {

	//Function: setReverseProxy
	//Routes all SDK network requests through a reverse proxy server instead of Pushwoosh servers directly.
	//The proxy server must be configured to forward requests to Pushwoosh APIs.
	//
	//Settings are not persisted and must be set on every app start.
	//Must be called before init() to ensure no SDK requests are sent without the proxy.
	//
	//When the reverse proxy flag is enabled, the SDK blocks all network requests until
	//setReverseProxy() is called. This guarantees that no traffic goes directly to Pushwoosh servers.
	//
	//Prerequisites:
	// Android: add the following meta-data to AndroidManifest.xml:
	//   <meta-data android:name="com.pushwoosh.allow_reverse_proxy" android:value="true" />
	//
	// iOS: add the following key to Info.plist (main app target):
	//   Pushwoosh_ALLOW_REVERSE_PROXY = YES
	//
	// iOS Notification Service Extension (required for delivery tracking via proxy):
	//   If your app uses a Notification Service Extension (NSE), you must configure App Groups
	//   so the main app can share the proxy URL with the extension process:
	//   1. In Xcode, enable the "App Groups" capability for both the main app target
	//      and the NSE target with the same group identifier (e.g. "group.com.yourcompany.app").
	//   2. Add the following keys to Info.plist of BOTH the main app and the NSE target:
	//      PW_APP_GROUPS_NAME = group.com.yourcompany.app
	//      Pushwoosh_ALLOW_REVERSE_PROXY = YES
	//      Pushwoosh_APPID = XXXXX-XXXXX
	//   Without App Groups, the NSE cannot access the proxy URL and delivery event
	//   requests will either be sent directly to Pushwoosh servers or be silently dropped.
	//
	//Parameters:
	// "url" - reverse proxy URL (must be a valid https:// or http:// URL)
	// "headers" - optional map of custom HTTP headers to include in all requests (e.g. authorization headers)
	//
	//Example:
	//(start code)
	//	Pushwoosh.setReverseProxy("https://your-proxy.example.com/", { "X-Proxy-Auth": "my-token" });
	//	Pushwoosh.init({ pw_appid: "XXXXX-XXXXX" });
	//	Pushwoosh.register();
	//(end)
	setReverseProxy(url: string, headers: ?Object) {
		PushwooshModule.setReverseProxy(url, headers || null);
	}

	//Function: init
	//Call this first thing with your Pushwoosh App ID (pw_appid parameter).
	//
	//Example:
	//(start code)
	//	Pushwoosh.init({ pw_appid: "XXXXX-XXXXX" });
	//(end)
	init(config: Object, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.init(config, success, fail);
	}

    //Function: createLocalNotification
	//Creates a local notification with a specified message, delay and custom data
	//
	//Example:
	//(start code)
	//	//creates a local notification with "message" content, 5 seconds delay and passes {"somedata":"optional"} object in payload
	//	Pushwoosh.createLocalNotification({msg:"message", seconds:5, userData:{"somedata":"optional"}});
	//(end)

	createLocalNotification(data: Object){
		PushwooshModule.createLocalNotification(data);
	}

    //Function: clearLocalNotification
	//Clears all existing and cancels all pending local notifications
	//
	//Example:
	//(start code)
	//	Pushwoosh.clearLocalNotification();
	//(end)

	clearLocalNotification(){
		PushwooshModule.clearLocalNotification();
	}

    //Function: clearNotificationCenter
	//Clears all existing and cancels all pending notifications
	//
	//Example:
	//(start code)
	//	Pushwoosh.clearNotificationCenter();
	//(end)
	clearNotificationCenter(){
		PushwooshModule.clearNotificationCenter();
	}

	//Function: register
	//Call this to register for push notifications and retreive a push Token
	//
	//Example:
	//(start code)
	//	Pushwoosh.registerDevice(
	//		function(token)
	//		{
	//			alert(token);
	//		},
	//		function(status)
	//		{
	//			alert("failed to register: " +  status);
	//		}
	//	);
	//(end)
	register(success: ?Function, fail: ?Function) {
		if (!success) {
			success = function(token) {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.register(success, fail);
	}

	//Function: unregister
	//Unregisters device from push notifications
	unregister(success: ?Function, fail: ?Function) {
		if (!success) {
			success = function(token) {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.unregister(success, fail);
	}

	//Function: onPushOpen
	//Deprecated - use DeviceEventEmitter.addListener('pushOpened', callback) instead
	onPushOpen(callback: Function) {
		PushwooshModule.onPushOpen(callback);
	}

	//Function: setUserEmails
	//Register emails list associated to the current user.
	//
	//Example:
	//(start code)
	//	Pushwoosh.setUserEmails("someUser", ["example@mail.some"],
	//		function(status) {
	//			console.warn('setUserEmails success');
	//		},
	//		function(status) {
	//			console.warn('setUserEmails failed');
	//		}
	//	);
	//
	setUserEmails(userId: string, emails: Object, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.setUserEmails(userId, emails, success, fail);
	}


	//Function: setEmails
	//Register emails list associated to the current user.
	//
	//Example:
	//(start code)
	//	Pushwoosh.setEmails(["example@mail.some"],
	//		function(status) {
	//			console.warn('setEmails success');
	//		},
	//		function(status) {
	//			console.warn('setEmails failed');
	//		}
	//	);
	//
	setEmails(emails: Object, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.setEmails(emails, success, fail);
	}

	//Function: registerSMSNumber
	//Registers phone number associated to the current user.
	//SMS numbers must be in E.164 format (e.g., "+1234567890") and be valid.
	//
	//Example:
	//(start code)
	//	Pushwoosh.registerSMSNumber("+1234567890");
	//(end)
	registerSMSNumber(phoneNumber: string) {
		if (!phoneNumber || phoneNumber.trim() === '') {
			console.warn('Pushwoosh: SMS number is null or empty');
			return;
		}
		PushwooshModule.registerSMSNumber(phoneNumber);
	}

	//Function: registerWhatsappNumber
	//Registers WhatsApp number associated to the current user.
	//WhatsApp numbers must be in E.164 format (e.g., "+1234567890") and be valid.
	//
	//Example:
	//(start code)
	//	Pushwoosh.registerWhatsappNumber("+1234567890");
	//(end)
	registerWhatsappNumber(phoneNumber: string) {
		if (!phoneNumber || phoneNumber.trim() === '') {
			console.warn('Pushwoosh: WhatsApp number is null or empty');
			return;
		}
		PushwooshModule.registerWhatsappNumber(phoneNumber);
	}

	//Function: setTags
	//Call this to set tags for the device
	//
	//Example:
	//sets the following tags: "deviceName" with value "hello" and "deviceId" with value 10
	//(start code)
	//	Pushwoosh.setTags({deviceName:"hello", deviceId:10},
	//		function(status) {
	//			console.warn('setTags success');
	//		},
	//		function(status) {
	//			console.warn('setTags failed');
	//		}
	//	);
	//
	//	//settings list tags "MyTag" with values (array) "hello", "world"
	//	pushNotification.setTags({"MyTag":["hello", "world"]});
	//(end)
	setTags(tags: Object, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.setTags(tags, success, fail);
	}

	//Function: getTags
	//Call this to get tags for the device
	//
	//Example:
	//(start code)
	//	Pushwoosh.getTags(
	//		function(tags)
	//		{
	//			console.warn('tags for the device: ' + JSON.stringify(tags));
	//		},
	//		function(error)
	//		{
	//			console.warn('get tags error: ' + JSON.stringify(error));
	//		}
	//	);
	//(end)
	getTags(success: Function, fail: ?Function) {
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.getTags(success, fail);
	}

    //Function: setShowPushnotificationAlert
    //Set push notifications alert when push notification is received while the app is running, default is `true`
    //
    //Example:
    //(start code)
    //    Pushwoosh.setShowPushnotificationAlert(false);
    //(end)
    setShowPushnotificationAlert(showPushnotificationAlert: boolean) {
        PushwooshModule.setShowPushnotificationAlert(showPushnotificationAlert);
    }
    
    //Function: getShowPushnotificationAlert
    //Show push notifications alert when push notification is received while the app is running, default is `true`
    //
    //Example:
    //(start code)
    //    Pushwoosh.getShowPushnotificationAlert((showPushnotificationAlert) => {
    //                                           console.warn("showPushnotificationAlert = " + showPushnotificationAlert);
    //                                           });
    //(end)
    getShowPushnotificationAlert(callback: Function) {
        PushwooshModule.getShowPushnotificationAlert(callback);
    }
    
	//Function: getPushToken
	//Call this to get push token if it is available. Note the token also comes in registerDevice function callback.
	//
	//Example:
	//(start code)
	//	Pushwoosh.getPushToken(
	//		function(token)
	//		{
	//			console.warn('push token: ' + token);
	//		}
	//	);
	//(end)
	getPushToken(success: Function) {
		PushwooshModule.getPushToken(success);
	}

	//Function: getHwid
	//Call this to get Pushwoosh HWID used for communications with Pushwoosh API
	//
	//Example:
	//(start code)
	//	Pushwoosh.getHwid(
	//		function(token) {
	//			console.warn('Pushwoosh HWID: ' + token);
	//		}
	//	);
	//(end)
	getHwid(success: Function) {
		PushwooshModule.getHwid(success);
	}

	//Function: getUserId
	//Call this to get Pushwoosh User ID used for communications with Pushwoosh API
	//
	//Example:
	//(start code)
	//	Pushwoosh.getUserId();
	//(end)
	getUserId(success: Function) {
		PushwooshModule.getUserId(success);
	}

	//Function: setUserId
	//[android, ios] Set User indentifier. This could be Facebook ID, username or email, or any other user ID.
	//This allows data and events to be matched across multiple user devices.
	//
	//Parameters:
	// "userId" - user string identifier
	//
	setUserId(userId: string) {
		PushwooshModule.setUserId(userId);
	}

	//Function: setUserId: completion:
	//[android, ios] Set User indetifier. This could be Facebook ID, username or email, or any other user ID.
	//This allows data and events to be matched across multiple user devices.
	//If setUserId succeeds competion is called with nil argument. If setUserId fails completion is called with error.
	//Parameters:
	// "userId" - user string identifier
	setUserId(userId: string, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.setUserId(userId, success, fail);
	}

	//Function: postEvent
	//[android, ios] Post events for In-App Messages. This can trigger In-App message display as specified in Pushwoosh Control Panel.
	//
	//Parameters:
	// "event" - event to trigger
	// "attributes" - object with additional event attributes
	// 
	// Example:
	//(start code)
	// Pushwoosh.setUserId("XXXXXX");
	// Pushwoosh.postEvent("buttonPressed", { "buttonNumber" : 4, "buttonLabel" : "banner" });
	//(end)
	postEvent(event: string, attributes: ?Object) {
		if (!attributes) {
			attributes = {};
		}
		PushwooshModule.postEvent(event, attributes);
	}

	//Function: setApplicationIconBadgeNumber
	//[android, ios, wp8, windows] Set the application icon badge number
	//
	//Parameters:
	// "badgeNumber" - icon badge number
	//
	setApplicationIconBadgeNumber(badgeNumber: number) {
		PushwooshModule.setApplicationIconBadgeNumber(badgeNumber);
	}

	//Function: getApplicationIconBadgeNumber
	//[android, ios] Returns the application icon badge number
	//
	//Parameters:
	// "callback" - success callback
	//
	//Example:
	//(start code)
	//	Pushwoosh.getApplicationIconBadgeNumber(function(badge){ alert(badge);} );
	//(end)
	getApplicationIconBadgeNumber(callback: Function) {
		PushwooshModule.getApplicationIconBadgeNumber(callback);
	}
	
	//Function: addToApplicationIconBadgeNumber
	//[android, ios] Adds value to the application icon badge
	//
	//Parameters:
	// "badgeNumber" - incremental icon badge number
	//
	//Example:
	//(start code)
	//	Pushwoosh.addToApplicationIconBadgeNumber(5);
	//	Pushwoosh.addToApplicationIconBadgeNumber(-5);
	//(end)
	addToApplicationIconBadgeNumber(badgeNumber: number) {
		PushwooshModule.addToApplicationIconBadgeNumber(badgeNumber);
	}

	//Function: setMultiNotificationMode
	//[android] Allows multiple notifications to be displayed in the Android Notification Center
	setMultiNotificationMode(on: boolean) {
		PushwooshModule.setMultiNotificationMode(on);
	}

	//Function: setLightScreenOnNotification
	//[android] Turns the screen on if notification arrives
	//
	//Parameters:
	// "on" - enable/disable screen unlock (is disabled by default)
	//
	setLightScreenOnNotification(on: boolean) {
		PushwooshModule.setLightScreenOnNotification(on);
	}

	//Function: setEnableLED
	//[android] Enables led blinking when notification arrives and display is off
	//
	//Parameters:
	// "on" - enable/disable led blink (is disabled by default)
	//
	setEnableLED(on: boolean) {
		PushwooshModule.setEnableLED(on);
	}

	//Function: setEnableLED
	//[android] Set led color. Use with <setEnableLED>
	//
	//Parameters:
	// "color" - led color in ARGB integer format
	//
	setColorLED(color: number) {
		PushwooshModule.setColorLED(color);
	}

	//Function: setSoundType
	//[android] Sets default sound to play when push notification arrive.
	//
	//Parameters:
	// "type" - Sound type (0 - default, 1 - no sound, 2 - always)
	//
	setSoundType(type: number) {
		PushwooshModule.setSoundType(type);
	}

	//Function: setVibrateType
	//[android] Sets default vibration mode when push notification arrive.
	//
	//Parameters:
	// "type" - Vibration type (0 - default, 1 - no vibration, 2 - always)
	//
	setVibrateType(type: number) {
		PushwooshModule.setVibrateType(type);
	}

	//Function: presentInboxUI
	//[android, ios] Opens Inbox screen.
	//
	// Supported style keys:
	//
	// Customizes the date formatting
	// "dateFormat"
	//
	// The default icon in the cell next to the message; if not specified, the app icon is used
	// "defaultImageIcon"
	//
	// The appearance of the unread messages mark (iOS only)
	// "unreadImage"
	//
	// The image which is displayed if an error occurs and the list of inbox messages is empty
	// "listErrorImage"
	//
	// The image which is displayed if the list of inbox messages is empty
	// "listEmptyImage"
	//
	// The error text which is displayed when an error occurs; cannot be localized
	// "listErrorMessage"
	//
	// The text which is displayed if the list of inbox messages is empty; cannot be localized
	// "listEmptyMessage"
	//
	// The default text color (iOS only)
	// "defaultTextColor"
	//
	// The accent color
	// "accentColor"
	//
	// The default background color
	// "backgroundColor"
	//
	// The default selection color
	// "highlightColor"
	//
	// The color of message titles
	// "titleColor"
	//
	// The color of message titles if message was readed (Android only)
	// "readTitleColor"
	//
	// The color of messages descriptions
	// "descriptionColor"
	//
	// The color of messages descriptions if message was readed (Android only)
	// "readDescriptionColor"
	//
	// The color of message dates
	// "dateColor"
	//
	// The color of message dates if message was readed (Android only)
	// "readDateColor"
	//
	// The color of the separator
	// "dividerColor"
	//
	//Example:
	//(start code)
	//	Pushwoosh.presentInboxUI({ 
	//   "dateFormat" : "dd.MMMM.YYYY",
	//   "defaultImageIcon" : Image.resolveAssetSource(require('./icon.png')),
	//   "listErrorImage" : Image.resolveAssetSource(require('./error.png')),
	//	 "listEmptyImage" : Image.resolveAssetSource(require('./empty.png')),
	//   "listErrorMessage" : "Error message1",
	//   "listEmptyMessage" : "Error message2",
	//   "accentColor" : processColor('#ff00ff'),
	//   "highlightColor" : processColor('yellow'),
	//   "dateColor" : processColor('blue'),
	//   "titleColor" : processColor('#ff00ff'),
	//   "dividerColor" : processColor('#ff00ff'),
	//   "descriptionColor" : processColor('green'),
	//   "backgroundColor" : processColor('rgba(255, 100, 30, 1.0)'),
	//   "barBackgroundColor" : processColor('#ffffff'),
	//   "barAccentColor" : processColor('#ffd700'),
	//   "barTextColor" : processColor('#282828')
	// });
	//(end)

	presentInboxUI(style: ?Object) {
		PushwooshModule.presentInboxUI(style);
	}

	messagesWithNoActionPerformedCount(result: Function) {
		PushwooshModule.messagesWithNoActionPerformedCount(result);
	}

	unreadMessagesCount(result: Function) {
		PushwooshModule.unreadMessagesCount(result);
	}

	messagesCount(result: Function) {
		PushwooshModule.messagesCount(result);
	}

	loadMessages(success: Function, fail: ?Function) {
		if (!fail) {
			fail = function() {};
		}
		PushwooshModule.loadMessages(success, fail);
	}

	readMessage(id: string) {
		PushwooshModule.readMessage(id);
	}

	readMessages(ids: Array) {
		PushwooshModule.readMessages(ids);
	}

	deleteMessage(id: string) {
		PushwooshModule.deleteMessage(id);
	}

	deleteMessages(ids: Array) {
		PushwooshModule.deleteMessages(ids);
	}

	performAction(id: string) {
		PushwooshModule.performAction(id);
	}


	// Return flag is enable communication with server
	isCommunicationEnabled(success: Function){
		PushwooshModule.isCommunicationEnabled(success);
	}


	// Enable/disable all communication with Pushwoosh. Enabled by default.
	setCommunicationEnabled(enable: boolean, success: ?Function, fail: ?Function) {
		if (!success) {
			success = function() {};
		}
		if (!fail) {
			fail = function(error) {};
		}
		PushwooshModule.setCommunicationEnabled(enable, success, fail);
	}


	// Set notification icon background color
	setNotificationIconBackgroundColor(color: string) {
		PushwooshModule.setNotificationIconBackgroundColor(color);
	}

	// Set custom application language. Must be a lowercase two-letter code according to ISO-639-1 standard ("en", "de", "fr", etc.).
	// Device language used by default.
	// Set to null if you want to use device language again.
	setLanguage(language: string) {
		PushwooshModule.setLanguage(language);
	}

	// Enables Huawei push messaging
	enableHuaweiPushNotifications() {
		PushwooshModule.enableHuaweiPushNotifications();
	}

	// Sets the Rich Media presentation style.
	//
	// Parameters:
	// "type" - Rich Media style (Pushwoosh.RichMediaStyle.MODAL or Pushwoosh.RichMediaStyle.LEGACY)
	//
	// Example:
	// Pushwoosh.setRichMediaType(Pushwoosh.RichMediaStyle.MODAL);
	setRichMediaType(type: number) {
		PushwooshModule.setRichMediaType(type);
	}

	// Returns the current Rich Media presentation style.
	//
	// Parameters:
	// "callback" - callback function that receives the current style (MODAL, LEGACY)
	//
	// Example:
	// Pushwoosh.getRichMediaType((type) => {
	//	console.log("Rich Media Type: " + (type === Pushwoosh.RichMediaStyle.MODAL ? "MODAL" : "LEGACY"));
	// });
	getRichMediaType(callback: Function) {
		PushwooshModule.getRichMediaType(callback);
	}

}

// Export RichMediaStyle constants
PushNotification.prototype.RichMediaStyle = RichMediaStyle;

module.exports = new PushNotification();
