Skip to content

Commit

Permalink
feat(webengage): add new methods (#4784)
Browse files Browse the repository at this point in the history
* setDevicePushOptIn Added for Android 13

* notificaiton-onPrepared, GAID, userOptIn Added

* Refactoring
  • Loading branch information
akshay-engage authored Jul 11, 2024
1 parent 12b8046 commit 9b950eb
Showing 1 changed file with 40 additions and 13 deletions.
53 changes: 40 additions & 13 deletions src/@awesome-cordova-plugins/plugins/webengage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-pl
export class Webengage extends AwesomeCordovaNativePlugin {
/**
* Initializes WebEngage SDK
*
* @param {any} [config]
* @returns {Promise<any>}
*/
Expand All @@ -37,9 +36,17 @@ export class Webengage extends AwesomeCordovaNativePlugin {
return;
}

/**
* Starts Tracking Google Advertising ID
* @returns {Promise<any>}
*/
@Cordova()
startGAIDTracking(): Promise<any> {
return;
}

/**
* Sets WebEngage SDK configuration
*
* @param {string} key
* @param {any} value
* @returns {Promise<any>}
Expand All @@ -51,7 +58,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {

/**
* Tracks event
*
* @param {string} eventName
* @param {any} [attributes]
* @returns {Promise<any>}
Expand All @@ -63,7 +69,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {

/**
* Tracks screen
*
* @param {string} eventName
* @param screenName
* @param {any} [screenData]
Expand All @@ -87,7 +92,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {
export class WebengageUser extends AwesomeCordovaNativePlugin {
/**
* Logs user in
*
* @param {string} userId
* @returns {Promise<any>}
*/
Expand All @@ -98,7 +102,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {

/**
* Logs user out
*
* @returns {Promise<any>}
*/
@Cordova()
Expand All @@ -108,7 +111,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {

/**
* Sets user attribute
*
* @param {string} key
* @param {any} value
* @returns {Promise<any>}
Expand All @@ -117,6 +119,27 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
setAttribute(key: string, value: any): Promise<any> {
return;
}

/**
* Sets Device optIn
* @param {boolean} optIn
* @returns {Promise<any>}
*/
@Cordova()
setDevicePushOptIn(optIn: boolean): Promise<any> {
return;
}

/**
* Sets user attribute
* @param {string} channel
* @param {any} optIn
* @returns {Promise<any>}
*/
@Cordova()
setUserOptIn(channel: string, optIn: any): Promise<any> {
return;
}
}

/**
Expand All @@ -131,7 +154,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
export class WebengagePush extends AwesomeCordovaNativePlugin {
/**
* Callback function is invoked when a push notification is clicked
*
* @param {any} callback
* @returns {Promise<any>}
*/
Expand All @@ -142,7 +164,6 @@ export class WebengagePush extends AwesomeCordovaNativePlugin {

/**
* Sets push notification configuration
*
* @param {string} key
* @param {any} value
* @returns {Promise<any>}
Expand All @@ -165,7 +186,6 @@ export class WebengagePush extends AwesomeCordovaNativePlugin {
export class WebengageNotification extends AwesomeCordovaNativePlugin {
/**
* Callback function is invoked when a in-app notification is shown
*
* @param {any} callback
* @returns {Promise<any>}
*/
Expand All @@ -174,9 +194,18 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {
return;
}

/**
* Callback function is invoked before a in-app notification is shown
* @param {any} callback
* @returns {Promise<any>}
*/
@Cordova()
onPrepared(callback: any): Promise<any> {
return;
}

/**
* Callback function is invoked when a in-app notification is clicked
*
* @param {any} callback
* @returns {Promise<any>}
*/
Expand All @@ -187,7 +216,6 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {

/**
* Callback function is invoked when a in-app notification is dismissed
*
* @param {any} callback
* @returns {Promise<any>}
*/
Expand All @@ -198,7 +226,6 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {

/**
* Sets in-app notification configuration
*
* @param {string} key
* @param {any} value
* @returns {Promise<any>}
Expand Down

0 comments on commit 9b950eb

Please sign in to comment.