mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-07 23:03:19 +08:00
fixed doc of flurry analytics wrapper
This commit is contained in:
parent
ec8d318280
commit
ebb47ce591
@ -3,11 +3,10 @@ import { Injectable } from '@angular/core';
|
|||||||
|
|
||||||
export interface FlurryAnalyticsOptions {
|
export interface FlurryAnalyticsOptions {
|
||||||
/** Flurry API key is required */
|
/** Flurry API key is required */
|
||||||
appKey?: string;
|
appKey: string;
|
||||||
/**
|
/**
|
||||||
* Optional parameters
|
* Overrides the version of the app
|
||||||
*/
|
*/
|
||||||
/** Overrides the version of the app */
|
|
||||||
version?: string;
|
version?: string;
|
||||||
/**
|
/**
|
||||||
* How long can the app be paused before a new session is created,
|
* How long can the app be paused before a new session is created,
|
||||||
@ -61,8 +60,16 @@ export interface FlurryAnalyticsOptions {
|
|||||||
export interface FlurryAnalyticsLocation {
|
export interface FlurryAnalyticsLocation {
|
||||||
latitude: number;
|
latitude: number;
|
||||||
longitude: number;
|
longitude: number;
|
||||||
verticalAccuracy?: number; // optional iOS only
|
/**
|
||||||
horizontalAccuracy?: number; // optional iOS only
|
* Set altitude
|
||||||
|
* It is optional and use only for iOS
|
||||||
|
*/
|
||||||
|
verticalAccuracy?: number;
|
||||||
|
/**
|
||||||
|
* Set radius about 2d point
|
||||||
|
* It is optional and use only for iOS
|
||||||
|
*/
|
||||||
|
horizontalAccuracy?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,6 +113,7 @@ export class FlurryAnalytics {
|
|||||||
* Set the setting for Flurry Analytics
|
* Set the setting for Flurry Analytics
|
||||||
* @param appKey {string} API key is required
|
* @param appKey {string} API key is required
|
||||||
* @param options {FlurryAnalyticsOptions} is optional
|
* @param options {FlurryAnalyticsOptions} is optional
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
init(appKey: string, options?: FlurryAnalyticsOptions): Promise<any> {
|
init(appKey: string, options?: FlurryAnalyticsOptions): Promise<any> {
|
||||||
@ -115,46 +123,42 @@ export class FlurryAnalytics {
|
|||||||
/**
|
/**
|
||||||
* This function set the Event
|
* This function set the Event
|
||||||
* @param eventName {string} The param to configure name of Event
|
* @param eventName {string} The param to configure name of Event
|
||||||
* @param params is optional
|
* @param params {Object} optional
|
||||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
* @return {Promise<any>} Returns a promise that resolves when event is set
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 0
|
||||||
|
})
|
||||||
logEvent(eventName: string, params?: any): Promise<any> {
|
logEvent(eventName: string, params?: any): Promise<any> {
|
||||||
if (!eventName || typeof eventName !== 'string') {
|
|
||||||
console.error(`FlurryAnalytics.logEvent: eventName must be a string. Got ${eventName}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function start a timed event
|
* This function start a timed event
|
||||||
* @param eventName
|
* @param eventName
|
||||||
* @param params is optional
|
* @param params {Object} optional
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when timed event is started tracking
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
startTimedEvent(eventName: string, params?: any): Promise<any> {
|
successIndex: 1,
|
||||||
if (!eventName || typeof eventName !== 'string') {
|
errorIndex: 0
|
||||||
console.error(`FlurryAnalytics.startTimedEvent: eventName must be a string. Got ${eventName}`);
|
})
|
||||||
return;
|
startTimedEvent(eventName: string, params?: Object): Promise<any> {
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function complete a timed event
|
* This function complete a timed event
|
||||||
* @param eventName
|
* @param eventName
|
||||||
* @param params is optional
|
* @param params {Object} optional
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when timed event is ended tracking
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
endTimedEvent(eventName: string, params?: any): Promise<any> {
|
successIndex: 1,
|
||||||
if (!eventName || typeof eventName !== 'string') {
|
errorIndex: 0
|
||||||
console.error(`FlurryAnalytics.endTimedEvent: eventName must be a string. Got ${eventName}`);
|
})
|
||||||
return;
|
endTimedEvent(eventName: string, params?: Object): Promise<any> {
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,19 +166,19 @@ export class FlurryAnalytics {
|
|||||||
* This function log an error
|
* This function log an error
|
||||||
* @param code
|
* @param code
|
||||||
* @param message
|
* @param message
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 0
|
||||||
|
})
|
||||||
logError(code, message): Promise<any> {
|
logError(code, message): Promise<any> {
|
||||||
if ((!code || typeof code !== 'string') || (!message || typeof message !== 'string')) {
|
|
||||||
console.error(`FlurryAnalytics.logError: code must be a string. Got ${code}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function log a page view
|
* This function log a page view
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
logPageView(): Promise<any> {
|
logPageView(): Promise<any> {
|
||||||
@ -185,16 +189,20 @@ export class FlurryAnalytics {
|
|||||||
* This function set the location for the event
|
* This function set the location for the event
|
||||||
* (this is will only be used for very course grained statistics like city)
|
* (this is will only be used for very course grained statistics like city)
|
||||||
* @param location
|
* @param location
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova({
|
||||||
|
successIndex: 1,
|
||||||
|
errorIndex: 0
|
||||||
|
})
|
||||||
setLocation(location: FlurryAnalyticsLocation): Promise<any> {
|
setLocation(location: FlurryAnalyticsLocation): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function start the session
|
* This function start the session
|
||||||
* Only needed for older versions of Android
|
* Only needed for older versions of Android
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
startSession(): Promise<any> {
|
startSession(): Promise<any> {
|
||||||
@ -204,6 +212,7 @@ export class FlurryAnalytics {
|
|||||||
/**
|
/**
|
||||||
* This function end the session
|
* This function end the session
|
||||||
* Only needed for older versions of Android
|
* Only needed for older versions of Android
|
||||||
|
* @return {Promise<any>}
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
endSession(): Promise<any> {
|
endSession(): Promise<any> {
|
||||||
|
Loading…
Reference in New Issue
Block a user