@smartface/plugin-firebase
Version:
Smartface Firebase Plugin for Smartface Native Framework
170 lines (169 loc) • 6.05 kB
TypeScript
declare type LogErrorParams = {
error: string;
identifier?: string;
ios?: {
errorCode: number;
};
};
export default class Crashlytics {
static ios: {
/**
* If you would like to take advantage of advanced user identifier features, you can setUserName function.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.ios.setUserName("UserName");
*
* @method setUserName
* @param {String} UserName
* @ios
* @static
* @since 1.0
*/
setUserName: (name: string) => void;
/**
* If you would like to take advantage of advanced user identifier features, you can setUserEmail function.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.ios.setUserEmail("UserEmail");
*
* @method setUserEmail
* @param {String} UserEmail
* @ios
* @static
* @since 1.0
*/
setUserEmail: (email: string) => void;
crash: () => void;
/**
* Crashlytics version. In Android, always returns 0.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.ios.getVersion();
*
* @method getVersion
* @ios
* @static
* @since 1.0
*/
getVersion: () => any;
/**
* Initialize Crashlytics and all provided kits.Only the first call to this method is honored. Subsequent calls are no-ops.
* Call this method within your `app.js` and provide the kits you wish to use.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.ios.with([new Crashlytics()]);
*
* @method with
* @param {Array} kits
* @ios
* @static
* @since 1.0
*/
with: (kits: Array<Crashlytics>) => void;
};
/**
* You can use Crashlytics.setUserIdentifier to provide an ID number, token, or hashed value that uniquely identifies the end-user of your application without disclosing or transmitting any of their personal information.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.setUserIdentifier("UserIdentifier");
*
* @method setUserIdentifier
* @param {String} UserIdentifier
* @android
* @ios
* @static
* @since 1.0
*/
static setUserIdentifier(identifier: string): void;
/**
* Custom keys help you get the specific state of your app leading up to a crash. You can associate arbitrary key/value pairs with your crash reports, then use the custom keys to search and filter crash reports in the Firebase console.
* Setting keys are as easy as calling: Crashlytics.setBool(key, value).
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.setBool("key",true);
*
* @method setBool
* @param {String} key
* @param {boolean} value
* @android
* @ios
* @static
* @since 1.0
*/
static setBool(key: string, value: boolean): void;
/**
* Custom keys help you get the specific state of your app leading up to a crash. You can associate arbitrary key/value pairs with your crash reports, then use the custom keys to search and filter crash reports in the Firebase console.
* Setting keys are as easy as calling: Crashlytics.setFloat(key, value).
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.setFloat("key",true);
*
* @method setFloat
* @param {String} key
* @param {number} value
* @android
* @ios
* @static
* @since 1.0
*/
static setFloat(key: string, value: number): void;
/**
* Custom keys help you get the specific state of your app leading up to a crash. You can associate arbitrary key/value pairs with your crash reports, then use the custom keys to search and filter crash reports in the Firebase console.
* Setting keys are as easy as calling: Crashlytics.setInt(key, value).
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.setInt("key",true);
*
* @method setInt
* @param {String} key
* @param {number} value
* @android
* @ios
* @static
* @since 1.0
*/
static setInt(key: string, value: number): void;
/**
* Custom keys help you get the specific state of your app leading up to a crash. You can associate arbitrary key/value pairs with your crash reports, then use the custom keys to search and filter crash reports in the Firebase console.
* Setting keys are as easy as calling: Crashlytics.setString(key, value).
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* Crashlytics.setString("key","value");
*
* @method setString
* @param {String} key
* @param {String} value
* @android
* @ios
* @static
* @since 1.0
*/
static setString(key: string, value: string): void;
/**
* logError method helps you report the error with an optional identifier.
*
* @example
* import { Crashlytics } from '@smartface/plugin-firebase';
* const err = new Error('Unexpected error');
* const stringError = JSON.stringify(err, null, '\t');
* Crashlytics.logError({error: stringError, identifier: 'UnhandledException' });
*
* @method logError
* @param {LogErrorParams} params
* @android
* @ios
* @static
* @since 7.0
*/
static logError(params: LogErrorParams): void;
}
export {};