react-native-wonderpush
Version:
Mobile push notification delivery with the WonderPush service. The WonderPush ReactNative SDK is compatible with iOS and Android.
115 lines • 5.4 kB
TypeScript
import type { WonderPushChannel, WonderPushChannelGroup } from './types';
export default class WonderPush {
static setLogging(enable: boolean): Promise<void>;
static initialize(clientId: string, clientSecret: string): Promise<void>;
static initializeAndRememberCredentials(clientId: string, clientSecret: string): Promise<void>;
static getRememberedClientId(): Promise<string>;
static isInitialized(): Promise<boolean>;
static subscribeToNotifications(fallbackToSettings?: boolean): Promise<void>;
static unsubscribeFromNotifications(): Promise<void>;
static isSubscribedToNotifications(): Promise<boolean>;
static trackEvent(type: string, attributes?: Record<string, any>): Promise<void>;
static addTag(...tags: string[] | [string[]]): Promise<void>;
static removeTag(...tags: string[] | [string[]]): Promise<void>;
static removeAllTags(): Promise<void>;
static hasTag(tag: string): Promise<boolean>;
static getTags(): Promise<string[]>;
static getPropertyValue(property: string): Promise<any>;
static getPropertyValues(property: string): Promise<any[]>;
static addProperty(property: string, values: any | any[]): Promise<void>;
static removeProperty(property: string, values: any | any[]): Promise<void>;
static setProperty(property: string, values: any | any[]): Promise<void>;
static unsetProperty(property: string): Promise<void>;
static putProperties(properties: Record<string, any>): Promise<void>;
static getProperties(): Promise<Record<string, any>>;
static getCountry(): Promise<string>;
static setCountry(country: string | null): Promise<void>;
static getCurrency(): Promise<string>;
static setCurrency(currency: string | null): Promise<void>;
static getLocale(): Promise<string>;
static setLocale(locale: string | null): Promise<void>;
static getTimeZone(): Promise<string>;
static setTimeZone(timeZone: string | null): Promise<void>;
static getUserId(): Promise<string>;
static setUserId(userId: string): Promise<void>;
static getDeviceId(): Promise<string>;
static getInstallationId(): Promise<string>;
static getPushToken(): Promise<string>;
static getAccessToken(): Promise<string>;
static setRequiresUserConsent(value: boolean): Promise<void>;
static getUserConsent(): Promise<boolean>;
static setUserConsent(value: boolean): Promise<void>;
static disableGeolocation(): Promise<void>;
static enableGeolocation(): Promise<void>;
static setGeolocation(lat: number, lon: number): Promise<void>;
static clearEventsHistory(): Promise<void>;
static clearPreferences(): Promise<void>;
static clearAllData(): Promise<void>;
static downloadAllData(): Promise<string | null>;
static getInitialURL(): Promise<string>;
static setDelegate(delegate: {
urlForDeeplink?: (url: string, callback: (url: string | null) => void) => void;
onNotificationReceived?: (notification: any) => void;
onNotificationOpened?: (notification: any, buttonIndex?: number) => void;
} | null): void;
}
/**
* WonderPushUserPreferences provides access to notification channel preferences.
* On Android, this controls notification channels and channel groups.
* On iOS, these methods are no-ops (except getters which return default values).
*/
export declare class WonderPushUserPreferences {
/**
* Get the default channel ID.
* Returns "default" on iOS, the actual default channel ID on Android.
*/
static getDefaultChannelId(): Promise<string>;
/**
* Set the default channel ID.
* No-op on iOS, sets the default channel on Android.
*/
static setDefaultChannelId(id: string): Promise<void>;
/**
* Get a channel group by ID.
* Returns null on iOS, the actual channel group on Android if it exists.
*/
static getChannelGroup(groupId: string): Promise<WonderPushChannelGroup | null>;
/**
* Get a channel by ID.
* Returns null on iOS, the actual channel on Android if it exists.
*/
static getChannel(channelId: string): Promise<WonderPushChannel | null>;
/**
* Set all channel groups, replacing existing ones.
* No-op on iOS, replaces all channel groups on Android.
*/
static setChannelGroups(channelGroups: WonderPushChannelGroup[]): Promise<void>;
/**
* Set all channels, replacing existing ones.
* No-op on iOS, replaces all channels on Android.
*/
static setChannels(channels: WonderPushChannel[]): Promise<void>;
/**
* Add or update a channel group.
* No-op on iOS, adds or updates the channel group on Android.
*/
static putChannelGroup(channelGroup: WonderPushChannelGroup): Promise<void>;
/**
* Add or update a channel.
* No-op on iOS, adds or updates the channel on Android.
*/
static putChannel(channel: WonderPushChannel): Promise<void>;
/**
* Remove a channel group by ID.
* No-op on iOS, removes the channel group on Android.
*/
static removeChannelGroup(groupId: string): Promise<void>;
/**
* Remove a channel by ID.
* No-op on iOS, removes the channel on Android.
*/
static removeChannel(channelId: string): Promise<void>;
}
export { WonderPush };
export type { WonderPushChannel, WonderPushChannelGroup } from './types';
//# sourceMappingURL=index.d.ts.map