feat(webengage): add optional config with initialization (#2637)

* feat(webengage): add optional config with initialization

* Update index.ts
This commit is contained in:
Ashwin Dinesh 2018-08-17 01:31:54 +05:30 committed by Daniel Sogl
parent 3f415f9bef
commit ca9a702808

View File

@ -23,18 +23,17 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
plugin: 'cordova-plugin-webengage', plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage', pluginRef: 'webengage',
repo: 'https://github.com/WebEngage/cordova-plugin', repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS'] platforms: ['Android', 'iOS']
}) })
@Injectable() @Injectable()
export class Webengage extends IonicNativePlugin { export class Webengage extends IonicNativePlugin {
/** /**
* Initializes WebEngage SDK * Initializes WebEngage SDK
* @param {any} [config]
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
engage(): Promise<any> { engage(config?: any): Promise<any> {
return; return;
} }
@ -52,34 +51,33 @@ export class Webengage extends IonicNativePlugin {
/** /**
* Tracks event * Tracks event
* @param {string} eventName * @param {string} eventName
* @param {any} attributes * @param {any} [attributes]
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
track(eventName: string, attributes: any): Promise<any> { track(eventName: string, attributes?: any): Promise<any> {
return; return;
} }
/** /**
* Tracks screen * Tracks screen
* @param {string} eventName * @param {string} eventName
* @param {any} screenData * @param {any} [screenData]
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
screen(screenName: string, screenData: any): Promise<any> { screen(screenName: string, screenData?: any): Promise<any> {
return; return;
} }
} }
/**
* @hidden
*/
@Plugin({ @Plugin({
pluginName: 'Webengage', pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage', plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.user', pluginRef: 'webengage.user'
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
}) })
@Injectable() @Injectable()
export class WebengageUser extends IonicNativePlugin { export class WebengageUser extends IonicNativePlugin {
@ -114,14 +112,13 @@ export class WebengageUser extends IonicNativePlugin {
} }
} }
/**
* @hidden
*/
@Plugin({ @Plugin({
pluginName: 'Webengage', pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage', plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.push', pluginRef: 'webengage.push'
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
}) })
@Injectable() @Injectable()
export class WebengagePush extends IonicNativePlugin { export class WebengagePush extends IonicNativePlugin {
@ -147,14 +144,13 @@ export class WebengagePush extends IonicNativePlugin {
} }
} }
/**
* @hidden
*/
@Plugin({ @Plugin({
pluginName: 'Webengage', pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage', plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.notification', pluginRef: 'webengage.notification'
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
}) })
@Injectable() @Injectable()
export class WebengageNotification extends IonicNativePlugin { export class WebengageNotification extends IonicNativePlugin {