Skip to content

Commit 9b950eb

Browse files
feat(webengage): add new methods (#4784)
* setDevicePushOptIn Added for Android 13 * notificaiton-onPrepared, GAID, userOptIn Added * Refactoring
1 parent 12b8046 commit 9b950eb

File tree

1 file changed

+40
-13
lines changed
  • src/@awesome-cordova-plugins/plugins/webengage

1 file changed

+40
-13
lines changed

Diff for: src/@awesome-cordova-plugins/plugins/webengage/index.ts

+40-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-pl
2828
export class Webengage extends AwesomeCordovaNativePlugin {
2929
/**
3030
* Initializes WebEngage SDK
31-
*
3231
* @param {any} [config]
3332
* @returns {Promise<any>}
3433
*/
@@ -37,9 +36,17 @@ export class Webengage extends AwesomeCordovaNativePlugin {
3736
return;
3837
}
3938

39+
/**
40+
* Starts Tracking Google Advertising ID
41+
* @returns {Promise<any>}
42+
*/
43+
@Cordova()
44+
startGAIDTracking(): Promise<any> {
45+
return;
46+
}
47+
4048
/**
4149
* Sets WebEngage SDK configuration
42-
*
4350
* @param {string} key
4451
* @param {any} value
4552
* @returns {Promise<any>}
@@ -51,7 +58,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {
5158

5259
/**
5360
* Tracks event
54-
*
5561
* @param {string} eventName
5662
* @param {any} [attributes]
5763
* @returns {Promise<any>}
@@ -63,7 +69,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {
6369

6470
/**
6571
* Tracks screen
66-
*
6772
* @param {string} eventName
6873
* @param screenName
6974
* @param {any} [screenData]
@@ -87,7 +92,6 @@ export class Webengage extends AwesomeCordovaNativePlugin {
8792
export class WebengageUser extends AwesomeCordovaNativePlugin {
8893
/**
8994
* Logs user in
90-
*
9195
* @param {string} userId
9296
* @returns {Promise<any>}
9397
*/
@@ -98,7 +102,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
98102

99103
/**
100104
* Logs user out
101-
*
102105
* @returns {Promise<any>}
103106
*/
104107
@Cordova()
@@ -108,7 +111,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
108111

109112
/**
110113
* Sets user attribute
111-
*
112114
* @param {string} key
113115
* @param {any} value
114116
* @returns {Promise<any>}
@@ -117,6 +119,27 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
117119
setAttribute(key: string, value: any): Promise<any> {
118120
return;
119121
}
122+
123+
/**
124+
* Sets Device optIn
125+
* @param {boolean} optIn
126+
* @returns {Promise<any>}
127+
*/
128+
@Cordova()
129+
setDevicePushOptIn(optIn: boolean): Promise<any> {
130+
return;
131+
}
132+
133+
/**
134+
* Sets user attribute
135+
* @param {string} channel
136+
* @param {any} optIn
137+
* @returns {Promise<any>}
138+
*/
139+
@Cordova()
140+
setUserOptIn(channel: string, optIn: any): Promise<any> {
141+
return;
142+
}
120143
}
121144

122145
/**
@@ -131,7 +154,6 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
131154
export class WebengagePush extends AwesomeCordovaNativePlugin {
132155
/**
133156
* Callback function is invoked when a push notification is clicked
134-
*
135157
* @param {any} callback
136158
* @returns {Promise<any>}
137159
*/
@@ -142,7 +164,6 @@ export class WebengagePush extends AwesomeCordovaNativePlugin {
142164

143165
/**
144166
* Sets push notification configuration
145-
*
146167
* @param {string} key
147168
* @param {any} value
148169
* @returns {Promise<any>}
@@ -165,7 +186,6 @@ export class WebengagePush extends AwesomeCordovaNativePlugin {
165186
export class WebengageNotification extends AwesomeCordovaNativePlugin {
166187
/**
167188
* Callback function is invoked when a in-app notification is shown
168-
*
169189
* @param {any} callback
170190
* @returns {Promise<any>}
171191
*/
@@ -174,9 +194,18 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {
174194
return;
175195
}
176196

197+
/**
198+
* Callback function is invoked before a in-app notification is shown
199+
* @param {any} callback
200+
* @returns {Promise<any>}
201+
*/
202+
@Cordova()
203+
onPrepared(callback: any): Promise<any> {
204+
return;
205+
}
206+
177207
/**
178208
* Callback function is invoked when a in-app notification is clicked
179-
*
180209
* @param {any} callback
181210
* @returns {Promise<any>}
182211
*/
@@ -187,7 +216,6 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {
187216

188217
/**
189218
* Callback function is invoked when a in-app notification is dismissed
190-
*
191219
* @param {any} callback
192220
* @returns {Promise<any>}
193221
*/
@@ -198,7 +226,6 @@ export class WebengageNotification extends AwesomeCordovaNativePlugin {
198226

199227
/**
200228
* Sets in-app notification configuration
201-
*
202229
* @param {string} key
203230
* @param {any} value
204231
* @returns {Promise<any>}

0 commit comments

Comments
 (0)