UNPKG

@smartface/plugin-firebase

Version:

Smartface Firebase Plugin for Smartface Native Framework

72 lines (71 loc) 2.29 kB
import AnalyticsEvent from './events'; import AnalyticsParam from './params'; /** * Firebase Analytics service * @static * @public * @property {object} */ export default class Analytics { static Event: typeof AnalyticsEvent; static Param: typeof AnalyticsParam; /** * CustomAttribute for logCustom. * * @example * import Analytics from '@smartface/plugin-firebase'; * var attribute1 = new Analytics.CustomAttribute("key","value"); * var attribute2 = new Analytics.CustomAttribute("key",12); * * @android * @ios * @static * @since 1.0 */ static CustomAttribute: { new (key: string, value: string | number): { key: string; value: string | number; }; }; static ios: { native?: any; }; /** * Logs an app event. The event can have up to 25 parameters. Events with the same name must have the same parameters. Up to 500 event names are supported. * Using predefined events and/or parameters is recommended for optimal reporting. * * @android * @ios * @since 0.1 */ static logEvent(name: string, customAttributes: InstanceType<typeof Analytics.CustomAttribute> | InstanceType<typeof Analytics.CustomAttribute>[]): void; /** * Sets a user property to a given value. Up to 25 user property names are supported. * Once set, user property values persist throughout the app lifecycle and across sessions. * * @android * @ios * @since 0.1 */ static setUserProperty(name: string, value: string): void; /** * Sets the user ID property. This feature must be used in accordance with Google’s Privacy Policy. * * @android * @ios * @since 0.1 */ static setUserId(id: string): void; /** * Sets the current screen name, which specifies the current visual context in your app. * This helps identify the areas in your app where users spend their time and how they interact with your app. * Must be called on the main thread. * * @android * @ios * @since 0.1 */ static setCurrentScreen(screenName: string, screenClassOverride: null): void; static getAppInstanceId(callback: any): void; }