Skip to content

Commit

Permalink
feat(webengage): add optional config with initialization (#2637)
Browse files Browse the repository at this point in the history
* feat(webengage): add optional config with initialization

* Update index.ts
  • Loading branch information
ashwindmk authored and danielsogl committed Aug 16, 2018
1 parent 3f415f9 commit ca9a702
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions src/@ionic-native/plugins/webengage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit ca9a702

Please sign in to comment.