1.3.3 • Published 4 months ago

catapush-capacitor v1.3.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

catapush-capacitor

Catapush plugin for Capacitor.See the SETUP.md file for the complete installation guide.

Install

npm install catapush-capacitor
npx cap sync

API

setCatapushMessageDelegate(...)

setCatapushMessageDelegate(delegate: CatapushMessageDelegate) => Promise<void>

Sets a delegate that gets notified about new received or sent messages

ParamTypeDescription
delegateCatapushMessageDelegateObject that implements the CatapushMessageDelegate interface callbacks

setCatapushStateDelegate(...)

setCatapushStateDelegate(delegate: CatapushStateDelegate) => Promise<void>

Sets a delegate that gets notified when the status of the SDK changes

ParamTypeDescription
delegateCatapushStateDelegateObject that implements the CatapushStateDelegate interface callbacks

init(...)

init(options: { appId: string; }) => Promise<void>

Inits the Catapush native SDK.

ParamTypeDescription
options{ appId: string; }Your Catapush app ID needed to instantiate the iOS native SDK that can be retrieved from your Catapush dashboard.

setUser(...)

setUser(options: { identifier: string; password: string; }) => Promise<void>

Sets the user credentials in the Catapush native SDK.

ParamTypeDescription
options{ identifier: string; password: string; }Your Catapush user identifier and password.

start()

start() => Promise<void>

Start the Catapush native service.


allMessages()

allMessages() => Promise<AllMessagesResponse>

Retrieve all the Catapush messages stored for the current user.

Returns: Promise<AllMessagesResponse>


enableLog(...)

enableLog(options: { enabled: boolean; }) => Promise<void>

Enable the Catapush native SDK logging.

ParamTypeDescription
options{ enabled: boolean; }Enable or disable logging passing true or false in the enabled attribute.

sendMessage(...)

sendMessage(options: SendMessageParams) => Promise<void>

Send a message to the Catapush server for delivery.

ParamTypeDescription
optionsSendMessageParamsThe attributes of the message to be delivered.

getAttachmentUrlForMessage(...)

getAttachmentUrlForMessage(options: MessageIdParams) => Promise<CatapushFile>

Get a message attachment URL.

ParamTypeDescription
optionsMessageIdParamsThe ID of the message whose attachment needs to be retrieved.

Returns: Promise<CatapushFile>


resumeNotifications()

resumeNotifications() => Promise<void>

Resume displaying notification to the user. This setting is not persisted across Catapush SDK/app restarts. Android only.


pauseNotifications()

pauseNotifications() => Promise<void>

Pause displaying notification to the user. This setting is not persisted across Catapush SDK/app restarts. Android only.


enableNotifications()

enableNotifications() => Promise<void>

Enable the notification of messages to the user in the status bar. This setting is persisted across Catapush SDK/app restarts. Android only.


disableNotifications()

disableNotifications() => Promise<void>

Disable the notification of messages to the user in the status bar. This setting is persisted across Catapush SDK/app restarts. Android only.


sendMessageReadNotificationWithId(...)

sendMessageReadNotificationWithId(options: { id: string; }) => Promise<void>

Send the read notification of a message to the Catapush server.

ParamTypeDescription
options{ id: string; }The ID of the message to be marked as read.

Interfaces

CatapushMessageDelegate

MethodSignature
catapushMessageReceived(message: CatapushMessage) => void
catapushMessageSent(message: CatapushMessage) => void
catapushNotificationTapped(message: CatapushMessage) => void

CatapushMessage

PropType
idstring
senderstring
bodystring
subjectstring
previewTextstring
hasAttachmentboolean
channelstring
replyToIdstring
optionalDataMap<string, any>
receivedTimeDate
readTimeDate
sentTimeDate
stateCatapushMessageState

Map

PropType
sizenumber
MethodSignature
clear() => void
delete(key: K) => boolean
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void
get(key: K) => V | undefined
has(key: K) => boolean
set(key: K, value: V) => this

Date

Enables basic storage and retrieval of dates and times.

MethodSignatureDescription
toString() => stringReturns a string representation of a date. The format of the string depends on the locale.
toDateString() => stringReturns a date as a string value.
toTimeString() => stringReturns a time as a string value.
toLocaleString() => stringReturns a value as a string value appropriate to the host environment's current locale.
toLocaleDateString() => stringReturns a date as a string value appropriate to the host environment's current locale.
toLocaleTimeString() => stringReturns a time as a string value appropriate to the host environment's current locale.
valueOf() => numberReturns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
getTime() => numberGets the time value in milliseconds.
getFullYear() => numberGets the year, using local time.
getUTCFullYear() => numberGets the year using Universal Coordinated Time (UTC).
getMonth() => numberGets the month, using local time.
getUTCMonth() => numberGets the month of a Date object using Universal Coordinated Time (UTC).
getDate() => numberGets the day-of-the-month, using local time.
getUTCDate() => numberGets the day-of-the-month, using Universal Coordinated Time (UTC).
getDay() => numberGets the day of the week, using local time.
getUTCDay() => numberGets the day of the week using Universal Coordinated Time (UTC).
getHours() => numberGets the hours in a date, using local time.
getUTCHours() => numberGets the hours value in a Date object using Universal Coordinated Time (UTC).
getMinutes() => numberGets the minutes of a Date object, using local time.
getUTCMinutes() => numberGets the minutes of a Date object using Universal Coordinated Time (UTC).
getSeconds() => numberGets the seconds of a Date object, using local time.
getUTCSeconds() => numberGets the seconds of a Date object using Universal Coordinated Time (UTC).
getMilliseconds() => numberGets the milliseconds of a Date, using local time.
getUTCMilliseconds() => numberGets the milliseconds of a Date object using Universal Coordinated Time (UTC).
getTimezoneOffset() => numberGets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
setTime(time: number) => numberSets the date and time value in the Date object.
setMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using local time.
setUTCMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
setSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using local time.
setUTCSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using Universal Coordinated Time (UTC).
setMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using local time.
setUTCMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using Universal Coordinated Time (UTC).
setHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hour value in the Date object using local time.
setUTCHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hours value in the Date object using Universal Coordinated Time (UTC).
setDate(date: number) => numberSets the numeric day-of-the-month value of the Date object using local time.
setUTCDate(date: number) => numberSets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
setMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using local time.
setUTCMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using Universal Coordinated Time (UTC).
setFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year of the Date object using local time.
setUTCFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year value in the Date object using Universal Coordinated Time (UTC).
toUTCString() => stringReturns a date converted to a string using Universal Coordinated Time (UTC).
toISOString() => stringReturns a date as a string value in ISO format.
toJSON(key?: any) => stringUsed by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

CatapushStateDelegate

MethodSignature
catapushStateChanged(state: CatapushState) => void
catapushHandleError(error: CatapushError) => void

CatapushError

PropType
eventstring
codenumber

AllMessagesResponse

PropType
messagesCatapushMessage[]

SendMessageParams

PropType
bodystring
channelstring
replyTostring
fileCatapushFile

CatapushFile

PropType
mimeTypestring
urlstring

MessageIdParams

PropType
idstring

Enums

CatapushMessageState

MembersValue
RECEIVED'RECEIVED'
RECEIVED_CONFIRMED'RECEIVED_CONFIRMED'
OPENED'OPENED'
OPENED_CONFIRMED'OPENED_CONFIRMED'
NOT_SENT'NOT_SENT'
SENT'SENT'
SENT_CONFIRMED'SENT_CONFIRMED'

CatapushState

MembersValue
DISCONNECTED'DISCONNECTED'
CONNECTING'CONNECTING'
CONNECTED'CONNECTED'
1.3.3

4 months ago

1.3.2

7 months ago

1.3.1

8 months ago

1.3.0

10 months ago

1.2.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago