cordova-acoustic-mobile-push
Version:
Allows Cordova applications to integrate with Acoustic MCE Push Services
119 lines (118 loc) • 5.05 kB
TypeScript
export interface StringObject {
[key: string]: string;
}
export interface AnyObject {
[key: string]: any;
}
export declare type ImageCallback = (image: HTMLImageElement) => void;
/**
* @callback SdkVersionCallback
* @param {string} version a short string representing SDK version
*/
export declare type SdkVersionCallback = (version: string) => void;
export interface Registration {
/** A short string identifying the user, possibly multiple devices */
userId: string;
/**A short string identifying the channel or device */
channelId: string;
/**A medium string that represents the iOS device on APNS */
deviceToken: string;
/**A medium string that represents the Android device on GCM */
registrationId: string;
}
export declare type RegistrationCallback = (registration: Registration) => void;
export declare type RegisteredActionCallback = (
/** normally in the format { "type": <type>, "value": <value> } but can be whatever is sent in the "notification-action" or the "category-actions" section of the payload */
actionPayload: StringObject,
/** Entire Android or iOS payload for example {"aps":{"alert":"hello world", "category":"example"}} */
payload: StringObject) => void;
export declare type ActionCallback = (action: string) => void;
export interface Event {
/** Event type, SDK automatically sends events of "simpleNotification" and "application" types */
type: string;
/** Event name, SDK automatically sends events of "sessionStart", "sessionEnd", "urlClicked", "appOpened", "phoneNumberClicked" names */
name: string;
/** Timestamp that event occurred */
timestamp: Date;
/** Details about event, freeform key value pairs */
attributes: any;
/** Campaign name associated with event, optional */
attribution?: string;
}
export interface EventQueueFailure {
/** List of events that were sent*/
events: Event[];
/** Description of the error */
error: string;
}
/**
@callback EventQueueFailureCallback
@param result {Object}
@param result.events {Array.<Event>} List of events that were sent
@param result.error {string} Description of the error
*/
export declare type EventQueueFailureCallback = (result: EventQueueFailure) => void;
/**
@callback EventQueueSuccessCallback
@param events {Array.<Event>} List of events that were sent
*/
export declare type EventQueueSuccessCallback = (events: Event[]) => void;
export interface AttributeQueueResult {
/** Either "update" or "delete" depending on which method was called */
operation: "update" | "delete";
/** Either "channel" or "user" depending on which method was called */
domain: "channel" | "user";
/** Key value pairs that were updated if the operation was set or update */
attributes: any;
/** A list of keys that were deleted when the operation is delete */
keys: string[];
/** Description of the error, if any. */
error?: string;
}
/**
@callback AttributeQueueCallback
@param {AttributeQueueResult} result
*/
export declare type AttributeQueueCallback = (result: AttributeQueueResult) => void;
/**
@callback GetBadgeCallback
@param {number} badgeCount
*/
export declare type GetBadgeCallback = (badgeCount: number) => void;
/**
@callback AppKeyCallback
@param {string} appKey A short string for identifying the app in co.acoustic.mobilepushs system
*/
export declare type AppKeyCallback = (appKey: string) => void;
export declare type CordovaCallback = (data: any) => void;
/**
@callback registeredCallback
@param {boolean} co.acoustic.mobilepushRegistered will be either true or false and represents the device registering with the Acoustic infrastructure
@param {boolean} providerRegistered will be either true or false and represents the device registering the push provider system (APNS or GCM)
@param {string} providerName name of provider, eg "APNS", "FCM", or "GCM"
*/
export declare type RegisteredCallback = (mobilepushRegistered: boolean, providerRegistered: boolean, providerName: "APNS" | "GCM" | "FCM") => void;
/**
@callback CategoryCallback
@param {Object} payload Entire Android or iOS payload for example {"aps":{"alert":"hello world", "category":"example"}}
@param {string} identifier String identifying button to JavaScript processing click of button
*/
export declare type CategoryCallback = (payload: any, identifier: string) => void;
export interface Action {
/** When true the option shows in red */
destructive: boolean;
/** When true requires user to unlock device to execute action */
authentication: boolean;
/** String to display on button for user to select */
name: string;
/** String identifying button to JavaScript processing click of button */
identifier: string;
}
export interface Insets {
top: number;
left: number;
bottom: number;
right: number;
}
export declare type SafeAreaCallback = (value: Insets) => void;
export declare type BooleanCallback = (value: boolean) => void;