mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-08-04 00:00:08 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2d47104de |
@@ -111,26 +111,6 @@ export interface FirebaseUser {
|
||||
* name
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* whether the user is anonymous
|
||||
*/
|
||||
isAnonymous?: boolean;
|
||||
|
||||
/**
|
||||
* account creation timestamp in milliseconds
|
||||
*/
|
||||
creationTimestamp?: number;
|
||||
|
||||
/**
|
||||
* last sign-in timestamp in milliseconds
|
||||
*/
|
||||
lastSignInTimestamp?: number;
|
||||
|
||||
/**
|
||||
* array of linked provider info objects
|
||||
*/
|
||||
providers?: any[];
|
||||
}
|
||||
export interface MessagePayloadAps {
|
||||
alert?: {
|
||||
@@ -153,59 +133,6 @@ export interface MessagePayload {
|
||||
tap?: 'background' | 'foreground';
|
||||
aps?: MessagePayloadAps;
|
||||
}
|
||||
|
||||
export interface OnDeviceConversionUserIdentifier {
|
||||
/**
|
||||
* The user's email address. Mutually exclusive with phoneNumber.
|
||||
*/
|
||||
emailAddress?: string;
|
||||
|
||||
/**
|
||||
* The user's phone number in E.164 format. Mutually exclusive with emailAddress.
|
||||
*/
|
||||
phoneNumber?: string;
|
||||
}
|
||||
|
||||
export interface EnrollSecondAuthFactorOptions {
|
||||
/**
|
||||
* A display name for this factor. Auto-generated (masking all but the last 4 digits of the phone number) if not provided.
|
||||
*/
|
||||
displayName?: string;
|
||||
}
|
||||
|
||||
export interface VerifySecondAuthFactorParams {
|
||||
/**
|
||||
* Index of the enrolled factor to verify (for an MFA sign-in challenge).
|
||||
*/
|
||||
selectedIndex?: number;
|
||||
|
||||
/**
|
||||
* The verification ID from phone verification.
|
||||
*/
|
||||
verificationId?: string;
|
||||
|
||||
/**
|
||||
* The SMS verification code entered by the user.
|
||||
*/
|
||||
code?: string;
|
||||
}
|
||||
|
||||
export interface EnrolledSecondAuthFactor {
|
||||
/**
|
||||
* The factor's index.
|
||||
*/
|
||||
index: number;
|
||||
|
||||
/**
|
||||
* The enrolled phone number.
|
||||
*/
|
||||
phoneNumber: string;
|
||||
|
||||
/**
|
||||
* The display name for this factor, if set.
|
||||
*/
|
||||
displayName?: string;
|
||||
}
|
||||
/**
|
||||
* @name Firebase X
|
||||
* @description
|
||||
@@ -233,10 +160,6 @@ export interface EnrolledSecondAuthFactor {
|
||||
* ```
|
||||
* @interfaces
|
||||
* IChannelOptions
|
||||
* OnDeviceConversionUserIdentifier
|
||||
* EnrollSecondAuthFactorOptions
|
||||
* VerifySecondAuthFactorParams
|
||||
* EnrolledSecondAuthFactor
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseX',
|
||||
@@ -267,66 +190,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for getId(). Returns the current Firebase Installation ID (FID).
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getInstallationId(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a valid Firebase Installation auth token (always force-refreshed).
|
||||
*
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
@Cordova()
|
||||
getInstallationToken(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the current Firebase Installation ID and all associated data. Firebase will generate a new FID on next access.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
deleteInstallationId(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a listener that is called whenever the Firebase Installation ID changes.
|
||||
*
|
||||
* @param {Function} fn - callback function to invoke with the new installation ID string
|
||||
*/
|
||||
@Cordova()
|
||||
registerInstallationIdChangeListener(fn: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a listener that is called when the application transitions to the foreground (iOS applicationDidBecomeActive / Android onResume).
|
||||
*
|
||||
* @param {Function} fn - callback function to invoke when the app becomes active
|
||||
*/
|
||||
@Cordova()
|
||||
registerApplicationDidBecomeActiveListener(fn: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a listener that is called when the application transitions to the background (iOS applicationDidEnterBackground / Android onPause).
|
||||
*
|
||||
* @param {Function} fn - callback function to invoke when the app enters the background
|
||||
*/
|
||||
@Cordova()
|
||||
registerApplicationDidEnterBackgroundListener(fn: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current FCM user.
|
||||
*
|
||||
@@ -398,20 +261,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS 12+ only.
|
||||
* Get notified when the user taps the notification settings action in the system notification settings.
|
||||
* Requires UNAuthorizationOptionProvidesAppNotificationSettings.
|
||||
*
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
})
|
||||
onOpenSettings(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permission to receive push notifications (will trigger prompt) and return hasPermission: true. iOS only (Android will always return true).
|
||||
*
|
||||
@@ -424,19 +273,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS 12+ only. Grant critical alert permission (bypasses Do Not Disturb and the ringer switch). Requires a special Apple entitlement.
|
||||
* On Android this is a no-op and returns false.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
grantCriticalPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permission to receive push notifications and return hasPermission: true. iOS only (Android will always return true).
|
||||
*
|
||||
@@ -447,16 +283,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS 12+ only. Check whether the app has critical alert permission. On Android this always returns false.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
hasCriticalPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister from firebase, used to stop receiving push notifications. Call this when you logout user from your app.
|
||||
*/
|
||||
@@ -602,16 +428,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current analytics data collection enabled state.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isAnalyticsCollectionEnabled(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable Crashlytics collection.
|
||||
*
|
||||
@@ -623,16 +439,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current Crashlytics data collection enabled state.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isCrashlyticsCollectionEnabled(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/disable performance collection.
|
||||
*
|
||||
@@ -644,16 +450,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current performance data collection enabled state.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isPerformanceCollectionEnabled(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event using Analytics
|
||||
*
|
||||
@@ -700,20 +496,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS only. Initiates on-device conversion measurement using an email address or phone number.
|
||||
* Only one identifier type may be provided per call.
|
||||
*
|
||||
* @param {OnDeviceConversionUserIdentifier} userIdentifier
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
initiateOnDeviceConversionMeasurement(userIdentifier: OnDeviceConversionUserIdentifier): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Crashlytics user identifier.
|
||||
* To diagnose an issue, it’s often helpful to know which of your users experienced a given crash.
|
||||
@@ -730,18 +512,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom key-value pair for Crashlytics crash reports. Appears in the "Keys" tab of a crash report.
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string | number | boolean} value
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setCrashlyticsCustomKey(key: string, value: string | number | boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulates (causes) a fatal native crash which causes a crash event to be sent to Crashlytics (useful for testing).
|
||||
* See the Firebase documentation regarding crash testing.
|
||||
@@ -782,16 +552,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the app crashed during the previous execution.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
didCrashOnPreviousExecution(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests verification of a phone number in order to authenticate a user and sign then into Firebase in your app.
|
||||
*
|
||||
@@ -823,57 +583,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enrolls a phone number as a second authentication factor (MFA) for the current user.
|
||||
*
|
||||
* @param {string} number - phone number to enroll as a second factor, in E.164 format
|
||||
* @param {EnrollSecondAuthFactorOptions} [opts] - optional parameters
|
||||
* @returns {Promise<any>} resolves with the enrollment result (contains verificationId for SMS code entry)
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
enrollSecondAuthFactor(number: string, opts?: EnrollSecondAuthFactorOptions): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies a second authentication factor during an MFA sign-in challenge or enrollment.
|
||||
*
|
||||
* @param {VerifySecondAuthFactorParams} params
|
||||
* @param {object} [opts] - reserved for future use
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
verifySecondAuthFactor(params: VerifySecondAuthFactorParams, opts?: object): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the second authentication factors enrolled for the current user.
|
||||
*
|
||||
* @returns {Promise<EnrolledSecondAuthFactor[]>}
|
||||
*/
|
||||
@Cordova()
|
||||
listEnrolledSecondAuthFactors(): Promise<EnrolledSecondAuthFactor[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an enrolled second authentication factor from the current user.
|
||||
*
|
||||
* @param {number} selectedIndex - index of the enrolled factor to remove (from listEnrolledSecondAuthFactors())
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
unenrollSecondAuthFactor(selectedIndex: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch current authentification system language, for example, the phone sms code.
|
||||
*
|
||||
@@ -917,19 +626,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an email/password credential without signing in. The returned credential can be used with
|
||||
* signInWithCredential(), linkUserWithCredential(), or reauthenticateWithCredential().
|
||||
*
|
||||
* @param email
|
||||
* @param password
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
authenticateUserWithEmailAndPassword(email: string, password: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs in user with custom token.
|
||||
*
|
||||
@@ -970,43 +666,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticates the user with Microsoft Sign-In via Firebase OAuthProvider. Returns a credential for use with signInWithCredential().
|
||||
*
|
||||
* @param locale - optional locale to pass to the Microsoft sign-in provider
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
authenticateUserWithMicrosoft(locale?: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticates the user with Facebook using an access token obtained from the Facebook SDK.
|
||||
* Returns a credential for use with signInWithCredential().
|
||||
*
|
||||
* @param accessToken - a Facebook access token obtained via the Facebook Login SDK
|
||||
*/
|
||||
@Cordova()
|
||||
authenticateUserWithFacebook(accessToken: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticates the user with a generic OAuth provider via Firebase OAuthProvider. Returns a credential for use with signInWithCredential().
|
||||
*
|
||||
* @param providerId - the OAuth provider ID (e.g. "github.com", "twitter.com", "yahoo.com")
|
||||
* @param customParameters - optional custom OAuth parameters to send to the provider
|
||||
* @param scopes - optional OAuth scopes to request from the provider
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
authenticateUserWithOAuth(providerId: string, customParameters?: object, scopes?: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Links the user account to an existing Firebase user account with credentials obtained using verifyPhoneNumber().
|
||||
* See the Android- and iOS-specific Firebase documentation for more info.
|
||||
@@ -1032,16 +691,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlinks a provider from the currently signed-in user, removing that sign-in method.
|
||||
*
|
||||
* @param {string} providerId - the provider ID to unlink (e.g. "google.com", "password", "phone")
|
||||
*/
|
||||
@Cordova()
|
||||
unlinkUserWithProvider(providerId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there is a current Firebase user signed into the app.
|
||||
*/
|
||||
@@ -1080,17 +729,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a verification email to the specified new email address before updating.
|
||||
* The email is only updated after the user clicks the verification link.
|
||||
*
|
||||
* @param email - the new email address to verify
|
||||
*/
|
||||
@Cordova()
|
||||
verifyBeforeUpdateEmail(email: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a verification email to the currently configured email address of the current Firebase user signed into the app.
|
||||
* When the user opens the contained link, their email address will have been verified.
|
||||
@@ -1139,37 +777,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a callback that fires whenever the user's ID token changes (sign-in, sign-out, and token refresh events).
|
||||
*
|
||||
* @param {Function} fn - callback function to invoke when the ID token changes
|
||||
*/
|
||||
@Cordova()
|
||||
registerAuthIdTokenChangeListener(fn: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures Firebase Auth to connect to a local Auth emulator for testing. Must be called before any other auth operations.
|
||||
*
|
||||
* @param {string} host - the emulator host (e.g. "localhost" or "10.0.2.2" for Android emulator)
|
||||
* @param {number} port - the emulator port (e.g. 9099)
|
||||
*/
|
||||
@Cordova()
|
||||
useAuthEmulator(host: string, port: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the custom claims from the current user's ID token. Custom claims are set server-side using the Firebase Admin SDK.
|
||||
*
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
getClaims(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Remote Config parameter values for your app.
|
||||
*
|
||||
@@ -1202,16 +809,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all Remote Config values back to defaults. Note: not currently available on iOS.
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
resetRemoteConfig(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Map of Firebase Remote Config key value pairs.
|
||||
*
|
||||
@@ -1237,7 +834,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Android only. Retrieve a Remote Config byte array.
|
||||
*
|
||||
* @deprecated Removed upstream in cordova-plugin-firebasex 20.0.0 (modular plugin rewrite); no longer present in the Remote Config API.
|
||||
* @param {string} key
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@@ -1437,86 +1033,6 @@ export class FirebaseX extends AwesomeCordovaNativePlugin {
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a document exists in a Firestore collection.
|
||||
*
|
||||
* @param {string} documentId - document ID of the document to check.
|
||||
* @param {string} collection - name of top-level collection to check.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
documentExistsInFirestoreCollection(documentId: string, collection: string): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a real-time listener on a single document in a Firestore collection.
|
||||
* The success callback is called multiple times: first with {eventType: "id", id: listenerId},
|
||||
* then with {eventType: "change", snapshot, source, fromCache} on each change.
|
||||
* Call removeFirestoreListener() with the returned listener ID to stop listening.
|
||||
*
|
||||
* @param {string} documentId - document ID of the document to listen to.
|
||||
* @param {string} collection - name of top-level collection to listen to.
|
||||
* @param {boolean} includeMetadata - whether to include metadata-only changes.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
})
|
||||
listenToDocumentInFirestoreCollection(
|
||||
documentId: string,
|
||||
collection: string,
|
||||
includeMetadata?: boolean
|
||||
): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a real-time listener on an entire Firestore collection, optionally filtered.
|
||||
* The success callback is called multiple times: first with {eventType: "id", id: listenerId},
|
||||
* then with {eventType: "change", documents: {...}} on each change.
|
||||
* Call removeFirestoreListener() with the returned listener ID to stop listening.
|
||||
*
|
||||
* @param {string} collection - name of top-level collection to listen to.
|
||||
* @param {Array} filters - filters to apply to the collection (same format as fetchFirestoreCollection()).
|
||||
* @param {boolean} includeMetadata - whether to include metadata-only changes.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
observable: true,
|
||||
})
|
||||
listenToFirestoreCollection(collection: string, filters?: any[], includeMetadata?: boolean): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a previously registered Firestore snapshot listener.
|
||||
*
|
||||
* @param {string} listenerId - the listener ID returned in the initial listener response.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
removeFirestoreListener(listenerId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes an HTTPS-callable Cloud Function by name.
|
||||
*
|
||||
* @param {string} name - the name of the Cloud Function to call.
|
||||
* @param {any} args - arguments to pass to the function (any JSON-serialisable value).
|
||||
* @returns {Promise<any>} the function's return value
|
||||
*/
|
||||
@Cordova()
|
||||
functionsHttpsCallable(name: string, args: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set new V2 consent mode
|
||||
*
|
||||
|
||||
@@ -9,6 +9,9 @@ export type Event =
|
||||
| 'notificationTapped'
|
||||
| 'tokenReceived'
|
||||
| 'registrationUpdated'
|
||||
/**
|
||||
* @deprecated No longer part of the supported events list in the upstream SDK (confirmed absent as of v8.6.0, and as far back as v5.0.0).
|
||||
*/
|
||||
| 'geofenceEntered'
|
||||
| 'actionTapped'
|
||||
| 'installationUpdated'
|
||||
@@ -18,6 +21,9 @@ export type Event =
|
||||
| 'inAppChat.availabilityUpdated'
|
||||
| 'inAppChat.unreadMessageCounterUpdated'
|
||||
| 'deeplink'
|
||||
/**
|
||||
* @deprecated No longer part of the supported events list in the upstream SDK (confirmed absent as of v8.6.0, and as far back as v5.0.0).
|
||||
*/
|
||||
| 'inAppChat.viewStateChanged';
|
||||
|
||||
export interface CustomEvent {
|
||||
@@ -34,6 +40,14 @@ export interface Configuration {
|
||||
geofencingEnabled?: boolean;
|
||||
inAppChatEnabled?: boolean;
|
||||
fullFeaturedInAppsEnabled?: boolean | undefined;
|
||||
/**
|
||||
* Set to true to enable debug logging.
|
||||
*/
|
||||
loggingEnabled?: boolean;
|
||||
/**
|
||||
* List of trusted domain strings for web views, e.g. ['example.com', 'trusted.org']
|
||||
*/
|
||||
trustedDomains?: string[];
|
||||
/**
|
||||
* Message storage save callback
|
||||
*/
|
||||
@@ -42,12 +56,40 @@ export interface Configuration {
|
||||
ios?: {
|
||||
notificationTypes?: string[]; // ['alert', 'badge', 'sound']
|
||||
forceCleanup?: boolean;
|
||||
/**
|
||||
* @deprecated Removed upstream in v7.3.0. Replaced by the top-level `loggingEnabled` option.
|
||||
*/
|
||||
logging?: boolean;
|
||||
/**
|
||||
* Set to true to disable automatic registration for remote notifications. Default: false
|
||||
*/
|
||||
registeringForRemoteNotificationsDisabled?: boolean;
|
||||
/**
|
||||
* Set to true to prevent the SDK from overriding UNUserNotificationCenterDelegate. Default: false
|
||||
*/
|
||||
overridingNotificationCenterDelegateDisabled?: boolean;
|
||||
/**
|
||||
* Set to true to prevent the SDK from unregistering for remote notifications when stopping the SDK or after depersonalization. Default: false
|
||||
*/
|
||||
unregisteringForRemoteNotificationsDisabled?: boolean;
|
||||
/**
|
||||
* Settings for web view configuration in in-app messages
|
||||
*/
|
||||
webViewSettings?: {
|
||||
title?: string;
|
||||
barTintColor?: string;
|
||||
titleColor?: string;
|
||||
tintColor?: string;
|
||||
};
|
||||
};
|
||||
android?: {
|
||||
notificationIcon?: string; // a resource name for a status bar icon (without extension), located in '/platforms/android/app/src/main/res/mipmap'
|
||||
notificationChannelId?: string; // identifier for notification channel
|
||||
notificationChannelName?: string; // user visible name for notification channel
|
||||
notificationSound?: string; // a resource name for a notification sound (without extension), located in '/platforms/android/app/src/main/res/raw'
|
||||
multipleNotifications?: boolean; // set to 'true' to enable multiple notifications
|
||||
notificationAccentColor?: string; // set to hex color value in format '#RRGGBB' or '#AARRGGBB'
|
||||
withBannerForegroundNotificationsEnabled?: boolean; // set to true to always display Push notifications as Banner
|
||||
firebaseOptions?: {
|
||||
apiKey: string;
|
||||
applicationId: string;
|
||||
@@ -78,9 +120,9 @@ export interface Configuration {
|
||||
icon?: string;
|
||||
textInputActionButtonTitle?: string;
|
||||
textInputPlaceholder?: string;
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -110,7 +152,14 @@ export interface Installation {
|
||||
deviceModel?: string;
|
||||
deviceSecure?: boolean;
|
||||
language?: string;
|
||||
/**
|
||||
* @deprecated Renamed upstream in v7.9.1 to `deviceTimezoneOffset`.
|
||||
*/
|
||||
deviceTimezoneId?: string;
|
||||
/**
|
||||
* UTC-related timezone offset that identifies the current timezone of a device.
|
||||
*/
|
||||
deviceTimezoneOffset?: string;
|
||||
applicationUserId?: string;
|
||||
deviceName?: string;
|
||||
customAttributes?: Record<string, string | number | boolean>;
|
||||
@@ -129,6 +178,14 @@ export interface PersonalizeContext {
|
||||
userIdentity: UserIdentity;
|
||||
userAttributes?: Record<string, string | number | boolean | any[]>;
|
||||
forceDepersonalize?: boolean;
|
||||
/**
|
||||
* Set to true if you want to keep the installation as a lead when personalizing it. Default: false
|
||||
*/
|
||||
keepAsLead?: boolean;
|
||||
/**
|
||||
* Set to true to mark this installation as primary for the personalized user. Default: false
|
||||
*/
|
||||
setDeviceAsPrimary?: boolean;
|
||||
}
|
||||
|
||||
export interface GeoData {
|
||||
@@ -276,6 +333,17 @@ export interface ChatSettingsIOS {
|
||||
navigationBarTitleColor: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception raised by the in-app chat widget and passed to the handler registered via `setChatExceptionHandler`.
|
||||
*/
|
||||
export interface ChatException {
|
||||
code: string;
|
||||
name: string;
|
||||
message: string;
|
||||
origin: string;
|
||||
platform: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Mobile Messaging
|
||||
* @description
|
||||
@@ -665,7 +733,7 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
|
||||
|
||||
/**
|
||||
* Updates JWT used for user data fetching and personalization.
|
||||
*
|
||||
*
|
||||
* @name setUserDataJwt
|
||||
* @param jwt - JWT in a predefined format
|
||||
* @param {Function} errorCallback will be called on error
|
||||
@@ -674,4 +742,127 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
|
||||
setUserDataJwt(jwt: string, errorCallback?: (error: MobileMessagingError) => void) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Un register all handlers for a MobileMessaging library event.
|
||||
*
|
||||
* @name unregisterAllHandlers
|
||||
* @param event
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
unregisterAllHandlers(event: Event): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the JWT provider used to authenticate in-app chat sessions.
|
||||
*
|
||||
* The `jwtProvider` callback returns a JSON Web Token (JWT) used for chat authentication,
|
||||
* either synchronously (returning a string) or asynchronously (returning a Promise<string>).
|
||||
* It may be invoked multiple times during the widget's lifecycle, so it should always return
|
||||
* a fresh and valid JWT.
|
||||
*
|
||||
* @param jwtProvider A callback function that returns a JWT string or a Promise that resolves to one.
|
||||
* @param errorCallback Optional error handler for catching exceptions thrown during JWT generation.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
setChatJwtProvider(jwtProvider: () => string | Promise<string>, errorCallback?: (error: any) => void): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the chat exception handler in case you want to intercept and display errors coming
|
||||
* from the chat on your own (instead of relying on the prebuilt error banners).
|
||||
* Passing `null` removes the previously set handler.
|
||||
*
|
||||
* @param exceptionHandler A function called with the chat exception when it is triggered, or `null` to remove the handler.
|
||||
* @param errorCallback Optional error handler for catching exceptions thrown when handling exceptions from the native side.
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
setChatExceptionHandler(
|
||||
exceptionHandler: ((exception: ChatException) => void) | null,
|
||||
errorCallback?: (error: any) => void
|
||||
): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if in-app chat is currently available.
|
||||
*
|
||||
* @name isChatAvailable
|
||||
* @param resultCallback will be called upon completion with the boolean availability value.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
isChatAvailable(resultCallback: (available: boolean) => void): void {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets chat language.
|
||||
*
|
||||
* @name setLanguage
|
||||
* @param language to be set
|
||||
* @param {Function} errorCallback will be called on error
|
||||
*/
|
||||
@Cordova()
|
||||
setLanguage(language: string, errorCallback?: (error: MobileMessagingError) => void) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set contextual data of the widget.
|
||||
*
|
||||
* @param data contextual data in the form of a JSON string
|
||||
* @param allMultiThreadStrategy multi-thread strategy flag, true -> ALL, false -> ACTIVE
|
||||
* @param {Function} errorCallback will be called on error
|
||||
*/
|
||||
@Cordova()
|
||||
sendContextualData(
|
||||
data: string,
|
||||
allMultiThreadStrategy: boolean,
|
||||
errorCallback?: (error: MobileMessagingError) => void
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up the SDK, removing all data and stopping all services.
|
||||
* After cleanup, you should call `init()` again with a new configuration to restart the SDK.
|
||||
* The JWT supplier is also cleared during cleanup.
|
||||
*
|
||||
* @name cleanup
|
||||
*/
|
||||
@Cordova()
|
||||
cleanup(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets chat customization.
|
||||
*
|
||||
* @name setChatCustomization
|
||||
* @param customization Chat customization JSON object.
|
||||
*/
|
||||
@Cordova()
|
||||
setChatCustomization(customization: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets widget theme.
|
||||
*
|
||||
* @name setWidgetTheme
|
||||
* @param widgetTheme Widget theme name.
|
||||
* @param {Function} errorCallback will be called on error
|
||||
*/
|
||||
@Cordova()
|
||||
setWidgetTheme(widgetTheme: string, errorCallback?: (error: MobileMessagingError) => void) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user