Compare commits

..
2 changed files with 130 additions and 128 deletions
@@ -62,35 +62,35 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/**
* Sets the user's consent for event and profile tracking.
*
* You must call this method separately for each active user profile,
* for example, when switching user profiles using `onUserLogin`.
*
* Consent Scenarios:
*
* 1. **Complete Opt-Out**
* `userOptOut = true`, `allowSystemEvents = false`
* → No events (custom or system) are saved locally or remotely. Maximum privacy.
*
* 2. **Full Opt-In**
* `userOptOut = false`, `allowSystemEvents = true`
* → All events (custom and system) are tracked. Default behavior.
*
* 3. **Partial Opt-In**
* `userOptOut = true`, `allowSystemEvents = true`
* → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
*
* ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
* In such cases, the SDK defaults to **Full Opt-In**.
*
* To re-enable full tracking after opting out, call with:
* `userOptOut = false`, `allowSystemEvents = true`.
*
* @param {boolean} userOptOut - Set to `true` to disable custom event tracking.
* @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking.
*/
/**
* Sets the user's consent for event and profile tracking.
*
* You must call this method separately for each active user profile,
* for example, when switching user profiles using `onUserLogin`.
*
* Consent Scenarios:
*
* 1. **Complete Opt-Out**
* `userOptOut = true`, `allowSystemEvents = false`
* → No events (custom or system) are saved locally or remotely. Maximum privacy.
*
* 2. **Full Opt-In**
* `userOptOut = false`, `allowSystemEvents = true`
* → All events (custom and system) are tracked. Default behavior.
*
* 3. **Partial Opt-In**
* `userOptOut = true`, `allowSystemEvents = true`
* → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
*
* ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
* In such cases, the SDK defaults to **Full Opt-In**.
*
* To re-enable full tracking after opting out, call with:
* `userOptOut = false`, `allowSystemEvents = true`.
*
* @param {boolean} userOptOut - Set to `true` to disable custom event tracking.
* @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking.
*/
@Cordova()
setOptOut(optOut: boolean, allowSystemEvents?: boolean): Promise<any> {
return;
@@ -361,7 +361,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
*/
@Cordova()
getUserEventLog(eventName: string): Promise<any> {
return;
return;
}
/**
@@ -372,7 +372,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
*/
@Cordova()
getUserEventLogCount(eventName: string): Promise<any> {
return;
return;
}
/**
@@ -382,7 +382,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
*/
@Cordova()
getUserLastVisitTs(): Promise<any> {
return;
return;
}
/**
@@ -392,7 +392,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
*/
@Cordova()
getUserAppLaunchCount(): Promise<any> {
return;
return;
}
/**
@@ -402,10 +402,9 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
*/
@Cordova()
getUserEventLogHistory(): Promise<any> {
return;
return;
}
/**
* @deprecated - Use getUserEventLog() instead
* Get Event First Time
@@ -670,7 +669,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
profileIncrementValueBy(key: string,value: number): Promise<any> {
profileIncrementValueBy(key: string, value: number): Promise<any> {
return;
}
@@ -682,7 +681,7 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
profileDecrementValueBy(key: string,value: number): Promise<any> {
profileDecrementValueBy(key: string, value: number): Promise<any> {
return;
}
@@ -706,9 +705,12 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
* Discards inApp notifications until 'resumeInAppNotifications' is called for current session.
* Automatically resumes InApp notifications display on CleverTap shared instance creation.
* Pending inApp notifications are not displayed.
*
* @param dismissInAppIfVisible {boolean} - Optional. If true, also dismisses the currently visible InApp notification.
* @returns {Promise<any>}
*/
@Cordova()
discardInAppNotifications(): Promise<any> {
discardInAppNotifications(dismissInAppIfVisible?: boolean): Promise<any> {
return;
}
@@ -739,10 +741,10 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
* @param expiredOnly {boolean} - to clear only assets which will not be needed further for inapps
* @returns {Promise<any>}
*/
@Cordova()
clearFileResources(expiredOnly: boolean): Promise<any> {
return;
}
@Cordova()
clearFileResources(expiredOnly: boolean): Promise<any> {
return;
}
/**
* Fetches In Apps from server.
@@ -754,7 +756,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/*******************
* Session
******************/
@@ -1221,10 +1222,10 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
* @param {string} variable The String specifying the name of file varible to be created.
*/
@Cordova()
defineFileVariable(variable: string): Promise<any> {
return;
}
@Cordova()
defineFileVariable(variable: string): Promise<any> {
return;
}
/**
* Get a variable or a group for the specified name.
@@ -1245,6 +1246,28 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/**
* Returns information about the active A/B experiment variants for the current user.
* Each variant object contains an "id" key mapping to the numeric ID of the variant.
*
* @returns {Promise<any>} - Returns an array of variant objects.
*/
@Cordova()
variants(): Promise<any> {
return;
}
/**
* Clears any active mute state set by the backend, allowing the SDK to resume
* normal event tracking and network operations immediately.
*
* @returns {Promise<any>}
*/
@Cordova()
unmute(): Promise<any> {
return;
}
/**
* Adds a callback to be invoked when variables are initialised with server values. Will be called each time new values are fetched.
* @returns {Promise<any>}
@@ -1264,7 +1287,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/**
* Called when the value of the file variable is downloaded and ready
* @param {name} string the name of the variable
@@ -1302,7 +1324,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/****************************
* Custom Templates methods
****************************/
@@ -1331,105 +1352,104 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
}
/**
* Notify the SDK that an active custom template is dismissed. The active custom template is considered to be
* visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all
* other messages will be queued until the current one is dismissed.
* @param {string} templateName The name of the active template
* @returns {Promise<any>}
*/
* Notify the SDK that an active custom template is dismissed. The active custom template is considered to be
* visible to the user until this method is called. Since the SDK can show only one InApp message at a time, all
* other messages will be queued until the current one is dismissed.
* @param {string} templateName The name of the active template
* @returns {Promise<any>}
*/
@Cordova()
customTemplateSetDismissed(templateName: string): Promise<any> {
return;
}
/**
* Notify the SDK that an active custom template is presented to the user.
* @param {string} templateName The name of the active template
* @returns {Promise<any>}
*/
* Notify the SDK that an active custom template is presented to the user.
* @param {string} templateName The name of the active template
* @returns {Promise<any>}
*/
@Cordova()
customTemplateSetPresented(templateName: string): Promise<any> {
return;
}
/**
* Trigger a custom template action argument by name.
*
* @param {string} templateName The name of an active template for which the action is defined
* @param {string} argName The action argument na
* @returns {Promise<any>}
*/
* Trigger a custom template action argument by name.
*
* @param {string} templateName The name of an active template for which the action is defined
* @param {string} argName The action argument na
* @returns {Promise<any>}
*/
@Cordova()
customTemplateRunAction(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Retrieve a string argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
* Retrieve a string argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
@Cordova()
customTemplateGetStringArg(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Retrieve a number argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
* Retrieve a number argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
@Cordova()
customTemplateGetNumberArg(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Retrieve a boolean argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
* Retrieve a boolean argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
@Cordova()
customTemplateGetBooleanArg(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Retrieve a file argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
* Retrieve a file argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
@Cordova()
customTemplateGetFileArg(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Retrieve an object argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
* Retrieve an object argument by name.
*
* @param {string} templateName The name of an active template for which the argument is defined
* @param {string} argName The action argument name
* @returns {Promise<any>}
*/
@Cordova()
customTemplateGetObjectArg(templateName: string, argName: string): Promise<any> {
return;
}
/**
* Get a string representation of an active's template context with information about all arguments.
* @param {string} templateName The name of an active template
* @returns {Promise<any>}
*/
* Get a string representation of an active's template context with information about all arguments.
* @param {string} templateName The name of an active template
* @returns {Promise<any>}
*/
@Cordova()
customTemplateContextToString(templateName: string): Promise<any> {
return;
@@ -1469,7 +1489,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/*******************
* Developer Options
******************/
@@ -44,11 +44,12 @@ export interface InAppBrowserOptions {
/** (Android Only) Set to a valid hex color string, for example #00ff00 or #CC00ff00 (#aarrggbb), and it will change the footer color from default. Only has effect if user has footer set to yes */
footercolor?: string;
/**
* (Android Only) Sets whether the InappBrowser WebView is displayed fullscreen or not. In fullscreen mode, the status bar is hidden. Default value is yes.
* (Windows only) Set to yes to create the browser control without a border around it.
* Please note that if location=no is also specified, there will be no control presented to user to close IAB window.
*/
fullscreen?: 'yes' | 'no';
/**
* (Android Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* (Android & Windows Only) Set to yes to use the hardware back button to navigate backwards through the InAppBrowser's history.
* If there is no previous page, the InAppBrowser will close. The default value is yes, so you must set it to no if you want the back button to simply close the InAppBrowser.
*/
hardwareback?: 'yes' | 'no';
@@ -68,11 +69,7 @@ export interface InAppBrowserOptions {
hidespinner?: 'yes' | 'no';
/** (Android) Set to yes to hide the url bar on the location toolbar, only has effect if user has location set to yes. The default value is no. */
hideurlbar?: 'yes' | 'no';
/**
* (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes).
*
* @deprecated UIWebView-only option, removed upstream in cordova-plugin-inappbrowser 4.0.0. iOS always uses WKWebView now.
*/
/** (iOS Only) Set to yes or no to open the keyboard when form elements receive focus via JavaScript's focus() call (defaults to yes). */
keyboardDisplayRequiresUserAction?: 'yes' | 'no';
/**
* (Android) Set to yes to swap positions of the navigation buttons and the close button. Specifically, navigation buttons go to the left and close button to the right.
@@ -94,11 +91,7 @@ export interface InAppBrowserOptions {
presentationstyle?: 'pagesheet' | 'formsheet' | 'fullscreen';
/** (Android Only) Set to yes to make InAppBrowser WebView to pause/resume with the app to stop background audio (this may be required to avoid Google Play issues) */
shouldPauseOnSuspend?: 'yes' | 'no';
/**
* (iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no).
*
* @deprecated UIWebView-only option, removed upstream in cordova-plugin-inappbrowser 4.0.0. iOS always uses WKWebView now.
*/
/** (iOS Only) Set to yes or no to wait until all new view content is received before being rendered (defaults to no). */
suppressesIncrementalRendering?: 'yes' | 'no';
/** (iOS Only) Set to yes or no to turn the toolbar on or off for the InAppBrowser (defaults to yes) */
toolbar?: 'yes' | 'no';
@@ -115,19 +108,10 @@ export interface InAppBrowserOptions {
transitionstyle?: 'fliphorizontal' | 'crossdissolve' | 'coververtical';
/** (Android Only) Sets whether the WebView should enable support for the "viewport" HTML meta tag or should use a wide viewport. When the value of the setting is no, the layout width is always set to the width of the WebView control in device-independent (CSS) pixels. When the value is yes and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. (defaults to yes). */
useWideViewPort?: 'yes' | 'no';
/**
* (iOS Only) Set to yes to use WKWebView engine for the InappBrowser. Omit or set to no (default) to use UIWebView.
*
* @deprecated UIWebView was removed upstream in cordova-plugin-inappbrowser 4.0.0. iOS always uses WKWebView now, making this option a no-op.
*/
/** (iOS Only) Set to yes to use WKWebView engine for the InappBrowser. Omit or set to no (default) to use UIWebView. */
usewkwebview?: 'yes' | 'no';
/** (Android Only) Enables the pinch-to-zoom gesture. Set to no to disable it. Default value is yes. */
/** (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes. */
zoom?: 'yes' | 'no';
/**
* (Android Only) Set to yes to show Android browser's zoom controls, set to no to hide them. Default value is yes.
* The zoom controls are deprecated since Android API Level 26 (Android 8); Google recommends disabling them.
*/
zoomcontrols?: 'yes' | 'no';
/**
* @hidden
*/
@@ -142,9 +126,7 @@ export type InAppBrowserEventType =
| 'beforeload'
| 'message'
| 'customscheme'
/** (Android Only) Fires when the InAppBrowser loads a URL that leads to downloading of a file. */
| 'download'
| string;
| string
export interface InAppBrowserEvent extends Event {
/** the event name */
@@ -263,6 +245,7 @@ export class InAppBrowserObject {
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
});
}
}
/**
@@ -302,7 +285,7 @@ export class InAppBrowserObject {
plugin: 'cordova-plugin-inappbrowser',
pluginRef: 'cordova.InAppBrowser',
repo: 'https://github.com/apache/cordova-plugin-inappbrowser',
platforms: ['Android', 'Browser', 'iOS'],
platforms: ['AmazonFire OS', 'Android', 'Browser', 'iOS', 'macOS', 'Windows'],
})
@Injectable()
export class InAppBrowser extends AwesomeCordovaNativePlugin {