import { Observable } from 'rxjs/Observable'; /** * @name Firebase * @description * This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported (including iOS 10). * * @usage * ``` * import { Firebase } from 'ionic-native'; * * Firebase.getToken() * .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device * .catch(error => console.error('Error getting token', error)); * * Firebase.onTokenRefresh() * .subscribe((token: string) => console.log(`Got a new token ${token}`)); * * ``` */ export declare class Firebase { /** * Get the device token * @return {Promise} */ static getToken(): Promise; /** * Get notified when a token is refreshed * @return {Observable} */ static onTokenRefresh(): Observable; /** * Get notified when the user opens a notification * @return {Observable} */ static onNotificationOpen(): Observable; /** * Grant permission to recieve push notifications * @return {Promise} */ static grantPermission(): Promise; /** * Check permission to recieve push notifications * @return {Promise} */ static hasPermission(): Promise; /** * Set icon badge number. Set to 0 to clear the badge. * @param badgeNumber {number} * @return {Promise} */ static setBadgeNumber(badgeNumber: number): Promise; /** * Get icon badge number * @return {Promise} */ static getBadgeNumber(): Promise; /** * Subscribe to a topic * @param topic {string} * @return {Promise} */ static subscribe(topic: string): Promise; /** * Unsubscribe from a topic * @param topic {string} * @return {Promise} */ static unsubscribe(topic: string): Promise; /** * Log an event using Analytics * @param type {string} * @param data {Object} * @return {Promise} */ static logEvent(type: string, data: any): Promise; /** * Set the name of the current screen in Analytics * @param name {string} Screen name * @return {Promise} */ static setScreenName(name: string): Promise; /** * Set a user id for use in Analytics * @param userId {string} * @return {Promise} */ static setUserId(userId: string): Promise; /** * Set a user property for use in Analytics * @param name {string} * @param value {string} * @return {Promise} */ static setUserProperty(name: string, value: string): Promise; /** * Fetch Remote Config parameter values for your app * @param cacheExpirationSeconds * @return {Promise} */ static fetch(cacheExpirationSeconds?: number): Promise; /** * Activate the Remote Config fetched config * @return {Promise} */ static activateFetched(): Promise; /** * Retrieve a Remote Config value * @param key {string} * @param namespace {string} * @return {Promise} */ static getValue(key: string, namespace?: string): Promise; /** * Retrieve a Remote Config byte array * @param key {string} * @param namespace {string} * @return {Promise} */ static getByteArray(key: string, namespace?: string): Promise; /** * Get the current state of the FirebaseRemoteConfig singleton object * @return {Promise} */ static getInfo(): Promise; /** * Change the settings for the FirebaseRemoteConfig object's operations * @param settings {Object} * @return {Promise} */ static setConfigSettings(settings: any): Promise; /** * Set defaults in the Remote Config * @param defaults {Object} * @param namespace {string} * @return {Promise} */ static setDefaults(defaults: any, namespace: string): Promise; }