import type { PluginListenerHandle } from '@capacitor/core'; import type { AirshipPluginWrapper } from './AirshipPlugin'; import type { Android, iOS, NotificationResponseEvent, PushNotificationStatus, PushNotificationStatusChangedEvent, PushPayload, PushReceivedEvent, PushTokenReceivedEvent, PromptPermissionFallback } from './types'; /** * Airship Push. */ export declare class AirshipPush { private readonly plugin; /** * iOS only push methods. */ readonly iOS: AirshipPushIOS; /** * Android only push methods. */ readonly android: AirshipPushAndroid; constructor(plugin: AirshipPluginWrapper); /** * Enables/disables notifications on Airship. * * When enabled, it will cause the user to be prompted for * the permission on platforms that support it. * To get the result of the prompt, use `enableUserNotifications`. * @param enabled true to enable, false to disable * @returns A promise. */ setUserNotificationsEnabled(enabled: boolean): Promise; /** * Checks if user notifications are enabled or not on Airship. * @returns A promise with the result. */ isUserNotificationsEnabled(): Promise; /** * Enables user notifications. * @param options Optional options. * @returns A promise with the permission result. */ enableUserNotifications(options?: { fallback?: PromptPermissionFallback; }): Promise; /** * Gets the notification status. * @returns A promise with the result. */ getNotificationStatus(): Promise; /** * Gets the registration token if generated. * Use the event EventType.PushTokenReceived to be notified * when available. * @returns A promise with the result. */ getPushToken(): Promise; /** * Gets the list of active notifications. * * On Android, this list only includes notifications * sent through Airship. * @returns A promise with the result. */ getActiveNotifications(): Promise; /** * Clears all notifications for the app. * @returns A promise with the result. */ clearNotifications(): Promise; /** * Clears a specific notification. * * On Android, you can use this method to clear * notifications outside of Airship, The identifier is in * the format of :. * @param identifier The identifier. * @returns A promise with the result. */ clearNotification(identifier: string): Promise; /** * Adds a notification response event listener. */ onNotificationResponse(listener: (event: NotificationResponseEvent) => void): Promise; /** * Adds a push received event listener. */ onPushReceived(listener: (event: PushReceivedEvent) => void): Promise; /** * Adds a notification status changed event listener. */ onNotificationStatusChanged(listener: (event: PushNotificationStatusChangedEvent) => void): Promise; /** * Adds a notification status changed event listener. */ onPushTokenReceived(listener: (event: PushTokenReceivedEvent) => void): Promise; } /** * iOS Push. */ export declare class AirshipPushIOS { private readonly plugin; constructor(plugin: AirshipPluginWrapper); /** * Sets the foreground presentation options. * @param options The foreground options. * @returns A promise. */ setForegroundPresentationOptions(options: iOS.ForegroundPresentationOption[]): Promise; /** * Sets the notification options. * @param options The notification options. * @returns A promise. */ setNotificationOptions(options: iOS.NotificationOption[]): Promise; /** * Checks if autobadge is enabled. * @returns A promise with the result. */ isAutobadgeEnabled(): Promise; /** * Enables/disables autobadge. * @param enabled true to enable, false to disable. * @returns A promise. */ setAutobadgeEnabled(enabled: boolean): Promise; /** * Set the badge number. * @param badge The badge number. * @returns A promise. */ setBadgeNumber(badge: number): Promise; /** * Gets the badge number. * @returns A promise with the result. */ getBadgeNumber(): Promise; /** * Enables/disables quiet time. * * @param enabled true to enable, false to disable * @returns A promise with the result. */ setQuietTimeEnabled(enabled: boolean): Promise; /** * Checks if quiet time is enabled or not. * @returns A promise with the result. */ isQuietTimeEnabled(): Promise; /** * Sets quiet time. * * @param quietTime The quiet time. * @returns A promise with the result. */ setQuietTime(quietTime: iOS.QuietTime): Promise; /** * Gets the quiet time settings. * * @returns A promise with the result. */ getQuietTime(): Promise; /** * Adds a authorized settings changed event listener. */ onAuthorizedSettingsChanged(listener: (event: iOS.AuthorizedNotificationSettingsChangedEvent) => void): Promise; } /** * Android Push. */ export declare class AirshipPushAndroid { private readonly plugin; constructor(plugin: AirshipPluginWrapper); /** * Checks if a notification category/channel is enabled. * @param channel The channel name. * @returns A promise with the result. */ isNotificationChannelEnabled(channel: string): Promise; /** * Sets the notification config. * @param config The notification config. * @returns A promise with the result. */ setNotificationConfig(config: Android.NotificationConfig): Promise; /** * Enables/disables showing notifications in the foreground. * @param enabled true to enable, false to disable. * @returns A promise with the result. */ setForegroundNotificationsEnabled(enabled: boolean): Promise; }