Merge branch 'master' into v5

This commit is contained in:
Daniel
2018-04-09 20:06:25 +02:00
40 changed files with 672 additions and 503 deletions
@@ -1,5 +1,10 @@
import { checkAvailability, CordovaInstance, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
import {
checkAvailability,
CordovaInstance,
IonicNativePlugin,
Plugin
} from '@ionic-native/core';
export interface FlurryAnalyticsOptions {
/** Flurry API key is required */
@@ -76,14 +81,12 @@ export interface FlurryAnalyticsLocation {
* @hidden
*/
export class FlurryAnalyticsObject {
constructor(private _objectInstance: any) {
}
constructor(private _objectInstance: any) {}
/**
* This function set the Event
* @param eventName {string} Name of the event
* @param [params] {Object} Optional params
* @param {string} eventName Name of the event
* @param {Object} [params] Optional params
* @return {Promise<any>} Returns a promise that resolves when event is sent
*/
@CordovaInstance({
@@ -96,8 +99,8 @@ export class FlurryAnalyticsObject {
/**
* Start a timed event
* @param eventName {string} Name of the event
* @param [params] {Object} Optional params
* @param {string} eventName Name of the event
* @param {Object} Optional params
* @return {Promise<any>} Returns a promise that resolves when timed event is started tracking
*/
@CordovaInstance({
@@ -110,8 +113,8 @@ export class FlurryAnalyticsObject {
/**
* Complete a timed event
* @param eventName {string} Name of the event
* @param [params] {Object} Optional params
* @param {string} eventName Name of the event
* @param {Object} [params] Optional params
* @return {Promise<any>} Returns a promise that resolves when timed event is ended tracking
*/
@CordovaInstance({
@@ -124,8 +127,8 @@ export class FlurryAnalyticsObject {
/**
* This function log an error
* @param code
* @param message
* @param {Object} code
* @param {Object} message
* @return {Promise<any>}
*/
@CordovaInstance()
@@ -145,12 +148,15 @@ export class FlurryAnalyticsObject {
/**
* This function set the location for the event
* (this is will only be used for very course grained statistics like city)
* @param location {FlurryAnalyticsLocation}
* @param message {string}
* @param {FlurryAnalyticsLocation} location
* @param {string} message
* @return {Promise<any>}
*/
@CordovaInstance()
setLocation(location: FlurryAnalyticsLocation, message: string): Promise<any> {
setLocation(
location: FlurryAnalyticsLocation,
message: string
): Promise<any> {
return;
}
@@ -173,7 +179,6 @@ export class FlurryAnalyticsObject {
endSession(): Promise<any> {
return;
}
}
/**
@@ -217,22 +222,24 @@ export class FlurryAnalyticsObject {
})
@Injectable()
export class FlurryAnalytics extends IonicNativePlugin {
/**
* Creates a new instance of FlurryAnalyticsObject
* @param options {FlurryAnalyticsOptions} options
* @param {FlurryAnalyticsOptions} options Options
* @return {FlurryAnalyticsObject}
*/
create(options: FlurryAnalyticsOptions): FlurryAnalyticsObject {
let instance: any;
if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) {
if (
checkAvailability(
FlurryAnalytics.pluginRef,
null,
FlurryAnalytics.pluginName
) === true
) {
instance = new (window as any).FlurryAnalytics(options);
}
return new FlurryAnalyticsObject(instance);
}
}