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