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 | |
|---|---|---|---|
|
|
7517aa234f |
@@ -1,196 +1,18 @@
|
||||
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/**
|
||||
* Authorization status of the Background Fetch API. Returned by `BackgroundFetch#configure` and `BackgroundFetch#status`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
export enum BackgroundFetchStatus {
|
||||
/**
|
||||
* Background fetch updates are unavailable and the user cannot enable them again.
|
||||
* For example, this status can occur when parental controls are in effect for the current user.
|
||||
*/
|
||||
STATUS_RESTRICTED = 0,
|
||||
/**
|
||||
* The user explicitly disabled background behavior for this app or for the whole system.
|
||||
*/
|
||||
STATUS_DENIED = 1,
|
||||
/**
|
||||
* Background fetch is available and enabled.
|
||||
*/
|
||||
STATUS_AVAILABLE = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* [Android only] Network type constraint for scheduled tasks. Used with `BackgroundFetchConfig#requiredNetworkType`
|
||||
* and `BackgroundFetchTaskConfig#requiredNetworkType`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
export enum BackgroundFetchNetworkType {
|
||||
/**
|
||||
* No network constraint. The task will run regardless of network state.
|
||||
*/
|
||||
NONE = 0,
|
||||
/**
|
||||
* The task requires any active network connection.
|
||||
*/
|
||||
ANY = 1,
|
||||
/**
|
||||
* The task requires an unmetered (e.g. Wi-Fi) network connection.
|
||||
*/
|
||||
UNMETERED = 2,
|
||||
/**
|
||||
* The task requires a non-roaming network connection.
|
||||
*/
|
||||
NOT_ROAMING = 3,
|
||||
/**
|
||||
* The task requires a cellular (mobile data) network connection.
|
||||
*/
|
||||
CELLULAR = 4,
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration properties shared by both `BackgroundFetchConfig` and `BackgroundFetchTaskConfig`.
|
||||
*
|
||||
* Aside from `stopOnTerminate`, all properties are Android-only. iOS manages background execution
|
||||
* through its own system-controlled Background Fetch mechanism and does not support these constraints.
|
||||
*/
|
||||
export interface BackgroundFetchAbstractConfig {
|
||||
export interface BackgroundFetchConfig {
|
||||
/**
|
||||
* Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
|
||||
*/
|
||||
stopOnTerminate?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to initiate background-fetch events when the device is rebooted. Defaults to `false`.
|
||||
* NOTE: `startOnBoot` requires `stopOnTerminate: false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
startOnBoot?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to enable the Headless mechanism for handling fetch events after app termination.
|
||||
* Defaults to `false`. NOTE: Requires `stopOnTerminate: false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
enableHeadless?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] By default, the plugin uses Android's `JobScheduler` when possible and falls back to
|
||||
* `AlarmManager` for older devices. Set `true` to always use `AlarmManager` regardless of API level.
|
||||
* Defaults to `false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
forceAlarmManager?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Specify the kind of network connectivity required to run this task. Defaults to
|
||||
* `BackgroundFetchNetworkType.NONE`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
requiredNetworkType?: BackgroundFetchNetworkType;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to require the device's battery level to be above the "low battery" threshold
|
||||
* before running this task. Defaults to `false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
requiresBatteryNotLow?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to require the device's available storage to be above the "low storage"
|
||||
* threshold before running this task. Defaults to `false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
requiresStorageNotLow?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to require the device to be charging (or connected to permanent power, such
|
||||
* as an Android TV device) before running this task. Defaults to `false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
requiresCharging?: boolean;
|
||||
|
||||
/**
|
||||
* [Android only] Set `true` to require the device to be idle (not actively used) before running this task.
|
||||
* Defaults to `false`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
requiresDeviceIdle?: boolean;
|
||||
}
|
||||
|
||||
export interface BackgroundFetchConfig extends BackgroundFetchAbstractConfig {
|
||||
/**
|
||||
* The minimum interval in **minutes** between background-fetch events. Defaults to `15` minutes. The
|
||||
* minimum allowed value is `15` minutes.
|
||||
*
|
||||
* NOTE: The OS does not guarantee fetch events will fire at exactly this interval. iOS adjusts the
|
||||
* interval based on usage patterns and system conditions. This value is a *minimum*, not a schedule.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
minimumFetchInterval?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration for a custom scheduled task, provided to `BackgroundFetch#scheduleTask`.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
export interface BackgroundFetchTaskConfig extends BackgroundFetchAbstractConfig {
|
||||
/**
|
||||
* A unique identifier for this task. Use the same `taskId` with `BackgroundFetch#finish` to signal
|
||||
* completion and with `BackgroundFetch#stopTask` to cancel it. Use reverse-domain notation to avoid
|
||||
* collisions (e.g. `'com.foo.sync'`).
|
||||
*/
|
||||
taskId: string;
|
||||
|
||||
/**
|
||||
* The minimum delay in **milliseconds** before this task runs.
|
||||
*
|
||||
* NOTE: On iOS, the system may delay the task beyond this value depending on device conditions. On
|
||||
* Android, `JobScheduler` treats this as a minimum delay.
|
||||
*/
|
||||
delay: number;
|
||||
|
||||
/**
|
||||
* Set `true` to schedule a repeating task. Defaults to `false` (one-shot).
|
||||
*/
|
||||
periodic?: boolean;
|
||||
|
||||
/**
|
||||
* [iOS only] Set `true` to require a network connection before running this task. On Android, use
|
||||
* `requiredNetworkType` instead.
|
||||
*/
|
||||
requiresNetworkConnectivity?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Background Fetch
|
||||
* @description
|
||||
* Cross-platform Background Fetch implementation. This plugin will execute your provided callbackFn
|
||||
* whenever a background-fetch event occurs.
|
||||
*
|
||||
* ### iOS
|
||||
* There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the
|
||||
* most frequent possible value -- iOS determines the rate automatically based upon device usage and
|
||||
* time-of-day (ie: fetch-rate is about ~15min during prime-time hours; less frequently when the user is
|
||||
* presumed to be sleeping).
|
||||
*
|
||||
* ### Android
|
||||
* Uses `JobScheduler` (API 21+) or `AlarmManager` to schedule periodic callbacks. Additional constraints
|
||||
* (network, charging, idle) can be set via `BackgroundFetchConfig`.
|
||||
*
|
||||
* iOS Background Fetch Implementation. See: https://developer.apple.com/reference/uikit/uiapplication#1657399
|
||||
* iOS Background Fetch is basically an API which wakes up your app about every 15 minutes (during the user's prime-time hours) and provides your app exactly 30s of background running-time. This plugin will execute your provided callbackFn whenever a background-fetch event occurs. There is no way to increase the rate which a fetch-event occurs and this plugin sets the rate to the most frequent possible value of UIApplicationBackgroundFetchIntervalMinimum -- iOS determines the rate automatically based upon device usage and time-of-day (ie: fetch-rate is about ~15min during prime-time hours; less frequently when the user is presumed to be sleeping, at 3am for example).
|
||||
* For more detail, please see https://github.com/transistorsoft/cordova-plugin-background-fetch
|
||||
* @usage
|
||||
*
|
||||
@@ -201,23 +23,17 @@ export interface BackgroundFetchTaskConfig extends BackgroundFetchAbstractConfig
|
||||
* constructor(private backgroundFetch: BackgroundFetch) {
|
||||
*
|
||||
* const config: BackgroundFetchConfig = {
|
||||
* minimumFetchInterval: 15,
|
||||
* stopOnTerminate: false, // Set true to cease background-fetch from operating after user "closes" the app. Defaults to true.
|
||||
* }
|
||||
*
|
||||
* backgroundFetch.configure(config, (taskId: string) => {
|
||||
* backgroundFetch.configure(config)
|
||||
* .then(() => {
|
||||
* console.log('Background Fetch initialized');
|
||||
*
|
||||
* console.log('Background Fetch event received', taskId);
|
||||
* this.backgroundFetch.finish();
|
||||
*
|
||||
* this.backgroundFetch.finish(taskId);
|
||||
*
|
||||
* }, (taskId: string) => {
|
||||
* // OS has signalled that remaining background time is about to expire.
|
||||
* console.log('Background Fetch TIMEOUT', taskId);
|
||||
* this.backgroundFetch.finish(taskId);
|
||||
* }).then((status) => {
|
||||
* console.log('Background Fetch initialized', status);
|
||||
* }).catch(e => console.log('Error initializing background fetch', e));
|
||||
* })
|
||||
* .catch(e => console.log('Error initializing background fetch', e));
|
||||
*
|
||||
* // Start the background-fetch API. Your callbackFn provided to #configure will be executed each time a background-fetch event occurs. NOTE the #configure method automatically calls #start. You do not have to call this method after you #configure the plugin
|
||||
* backgroundFetch.start();
|
||||
@@ -231,38 +47,26 @@ export interface BackgroundFetchTaskConfig extends BackgroundFetchAbstractConfig
|
||||
* ```
|
||||
* @interfaces
|
||||
* BackgroundFetchConfig
|
||||
* BackgroundFetchTaskConfig
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'BackgroundFetch',
|
||||
plugin: 'cordova-plugin-background-fetch',
|
||||
pluginRef: 'BackgroundFetch',
|
||||
repo: 'https://github.com/transistorsoft/cordova-plugin-background-fetch',
|
||||
platforms: ['Android', 'iOS'],
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class BackgroundFetch extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Configures the plugin's fetch callbackFn.
|
||||
*
|
||||
* Calling `configure` automatically starts background-fetch (equivalent to calling `#start` immediately
|
||||
* after configuration).
|
||||
* Configures the plugin's fetch callbackFn
|
||||
*
|
||||
* @param {BackgroundFetchConfig} config Configuration for plugin
|
||||
* @param {Function} [onEvent] Callback fired when a background-fetch event is received. The `taskId`
|
||||
* string identifies which task fired -- pass it to `#finish` when done. Required as of plugin `7.0.0`.
|
||||
* @param {Function} [onTimeout] Callback fired when the OS signals that remaining background time is
|
||||
* about to expire. Call `#finish` immediately. Added in plugin `7.0.0`.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova({
|
||||
otherPromise: true,
|
||||
callbackOrder: 'reverse',
|
||||
})
|
||||
configure(
|
||||
config: BackgroundFetchConfig,
|
||||
onEvent?: (taskId: string) => void,
|
||||
onTimeout?: (taskId: string) => void
|
||||
): Promise<any> {
|
||||
configure(config: BackgroundFetchConfig): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -306,33 +110,4 @@ export class BackgroundFetch extends AwesomeCordovaNativePlugin {
|
||||
status(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule a custom one-shot or periodic background task in addition to the default fetch callback
|
||||
* registered with `#configure`.
|
||||
*
|
||||
* Custom tasks fire the same callback registered via `#configure`'s `onEvent` argument, with their
|
||||
* unique `taskId`. Use `#finish` with that `taskId` to signal completion.
|
||||
*
|
||||
* @param {BackgroundFetchTaskConfig} config Task configuration, including a unique `taskId` and a
|
||||
* minimum `delay` in milliseconds.
|
||||
* @returns {Promise<any>}
|
||||
* @since 7.0.0
|
||||
*/
|
||||
@Cordova()
|
||||
scheduleTask(config: BackgroundFetchTaskConfig): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel a specific task previously scheduled via `#scheduleTask`, identified by its `taskId`.
|
||||
*
|
||||
* @param taskId The identifier of the scheduled task to stop.
|
||||
* @returns {Promise<any>}
|
||||
* @since 7.0.0
|
||||
*/
|
||||
@Cordova()
|
||||
stopTask(taskId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,26 @@ 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?: {
|
||||
@@ -133,6 +153,59 @@ 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
|
||||
@@ -160,6 +233,10 @@ export interface MessagePayload {
|
||||
* ```
|
||||
* @interfaces
|
||||
* IChannelOptions
|
||||
* OnDeviceConversionUserIdentifier
|
||||
* EnrollSecondAuthFactorOptions
|
||||
* VerifySecondAuthFactorParams
|
||||
* EnrolledSecondAuthFactor
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseX',
|
||||
@@ -190,6 +267,66 @@ 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.
|
||||
*
|
||||
@@ -261,6 +398,20 @@ 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).
|
||||
*
|
||||
@@ -273,6 +424,19 @@ 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).
|
||||
*
|
||||
@@ -283,6 +447,16 @@ 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.
|
||||
*/
|
||||
@@ -428,6 +602,16 @@ 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.
|
||||
*
|
||||
@@ -439,6 +623,16 @@ 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.
|
||||
*
|
||||
@@ -450,6 +644,16 @@ 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
|
||||
*
|
||||
@@ -496,6 +700,20 @@ 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.
|
||||
@@ -512,6 +730,18 @@ 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.
|
||||
@@ -552,6 +782,16 @@ 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.
|
||||
*
|
||||
@@ -583,6 +823,57 @@ 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.
|
||||
*
|
||||
@@ -626,6 +917,19 @@ 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.
|
||||
*
|
||||
@@ -666,6 +970,43 @@ 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.
|
||||
@@ -691,6 +1032,16 @@ 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.
|
||||
*/
|
||||
@@ -729,6 +1080,17 @@ 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.
|
||||
@@ -777,6 +1139,37 @@ 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.
|
||||
*
|
||||
@@ -809,6 +1202,16 @@ 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.
|
||||
*
|
||||
@@ -834,6 +1237,7 @@ 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>}
|
||||
*/
|
||||
@@ -1033,6 +1437,86 @@ 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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user