Compare commits

..

12 Commits

Author SHA1 Message Date
Daniel Sogl
6c480237cf 6.9.0 2024-09-13 06:55:24 +00:00
renovate[bot]
f86836ab13 chore(deps): update dependency eslint-plugin-jsdoc to v50 (#4824) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 15:55:40 +02:00
renovate[bot]
1c21dd1a77 fix(deps): update dependency tslib to v2.7.0 (#4823) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:22:18 +02:00
renovate[bot]
657b31f67b chore(deps): update dependency winston to v3.14.2 (#4822) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:21:29 +02:00
akshay-engage
3168688ce4 feat(webengage): New Plugin for Notification Inbox (#4819)
* WebEngage SDK Security Added, New Plugin for Capacitor Inbox Added

* Added setLocation for Core

* Added NotificationResponse Type

* Changed count type from number to String

* Added dist library folders

* Revert "Added dist library folders"

This reverts commit ea77a41fea.

* Updated comments
2024-09-12 12:21:11 +02:00
ivo liondov
5f15119971 feat(approov-advanced-http): support approov3 methods (#4817)
* feat(approov-advanced-http): add approov3 methods

* fix(approov-advanced-http): fix remove exclusion url method name

* Keep master branch packages

---------

Co-authored-by: Richard Taylor <richard.taylor@criticalblue.com>
Co-authored-by: ivo.liondov <ivol@Sanctuary.local>
2024-09-12 12:20:45 +02:00
Anush-Shand
4471806f73 feat(clevertap): support clevertap-cordova 3.2.0 (#4814)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor

* feat(clevertap): update for latest CleverTap Cordova plugin

* chore: Update Repo from Ionic Native Repo

* fix: Code Changes for parity SDK-155

* fix: Indentation fixes for SDK-155

* fix: Code Repo fix while updating fork branch

* fix: Remove unnecessary adder .scripts Folder

* fix: Remove unwanted added folder .circleci

* fix: Remove unwanted added File .npmrc

* fix: Revert .Github Folder Changes to as per Ionic-Native master

* fix: Update changes as per ionic-native master

* fix: Code Repo fix while updating fork branch

fix: Remove unnecessary adder .scripts Folder

fix: Remove unwanted added folder .circleci

fix: Remove unwanted added File .npmrc

fix: Revert .Github Folder Changes to as per Ionic-Native master

fix: Update changes as per ionic-native master

* fix(CleverTap): Fix for missing methods issue #3491

* refactor(profile): remove setProfile methods for fb and google

* refactor(dynamic variables): remove Product A/B Testing (Dynamic Variables) code

* fix(product config): add key param to product config getters

* feat(identity): add a new public method getCleverTapID and deprecate existing CleverTapID methods

* feat(profile): add public methods to increment/decrement values set via User properties

* feat(profile): add public methods to increment/decrement values set via User properties

* feat(inapp): add public methods for suspending/discarding & resuming InApp Notifications

* feat(inbox): add new api for iOS to delete bulk inbox messages for given message ids

* refactor(xiaomi-push): add region as an extra mandatory parameter to setPushXiaomiToken

* Update index.ts to support cordova 2.7.0

* Update index.ts

* feat(clevertap): support clevertap-cordova 2.7.2

* feat(clevertap): support clevertap-cordova 2.7.2

* feat(clevertap): support clevertap-cordova 2.7.2

* task(SDK-3757) - Add support for cordova v3.0.0

- Adds 2 new APIs = clearInAppResources() and fetchInApps()

* task(SDK-3757) - Add support for cordova v3.2.0

- Removes xiaomi related APIs

---------

Co-authored-by: Peter Wilkniss <peter@clevertap.com>
Co-authored-by: Daniel Sogl <mytechde@outlook.com>
Co-authored-by: Darshan Pania <darshan@clevertap.com>
Co-authored-by: Surya <suryanarayan@clevertap.com>
Co-authored-by: SuryaClevertap <63039490+SuryaClevertap@users.noreply.github.com>
Co-authored-by: Piyush Kukadiya <piyush.kukadiya@clevertap.com>
Co-authored-by: piyush-kukadiya <61137760+piyush-kukadiya@users.noreply.github.com>
Co-authored-by: AishwaryaNanna <97506871+AishwaryaNanna@users.noreply.github.com>
2024-09-12 12:20:19 +02:00
Olga Koroleva
63f2fcbe99 feat(mobile-messaging): Added fullFeaturedInApps method to config, fetching of the Inbox methods and registerForRemoteAndroidNotifications method (#4810)
* feat(mobile-messaging): fullfeaturedInApps option to configuration, support of the Inbox methods and registerForAndroidRemoteNotifications method

* fix(mobile-messaging): cleanup
2024-09-12 12:19:52 +02:00
renovate[bot]
5aa432d0a2 chore(deps): update dependency lint-staged to v15.2.10 (#4813) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:19:32 +02:00
renovate[bot]
9569628c67 chore(deps): update dependency rollup to v4.21.3 (#4809) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:19:24 +02:00
renovate[bot]
d03b4cc113 chore(deps): update dependency eslint-plugin-jsdoc to v48.11.0 (#4808) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:19:15 +02:00
renovate[bot]
82be769a16 chore(deps): update dependency husky to v9.1.6 (#4806) [skip ci]
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-12 12:19:07 +02:00
8 changed files with 833 additions and 468 deletions

View File

@@ -1,3 +1,20 @@
# [6.9.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.8.0...v6.9.0) (2024-09-13)
### Bug Fixes
* **deps:** update dependency tslib to v2.7.0 ([#4823](https://github.com/danielsogl/awesome-cordova-plugins/issues/4823)) [skip ci] ([1c21dd1](https://github.com/danielsogl/awesome-cordova-plugins/commit/1c21dd1a7734e5cf82d9d64806d5b159d66f9d37))
### Features
* **approov-advanced-http:** support approov3 methods ([#4817](https://github.com/danielsogl/awesome-cordova-plugins/issues/4817)) ([5f15119](https://github.com/danielsogl/awesome-cordova-plugins/commit/5f1511997101c750e80adb85e2c6b0dfacaf5a31))
* **clevertap:** support clevertap-cordova 3.2.0 ([#4814](https://github.com/danielsogl/awesome-cordova-plugins/issues/4814)) ([4471806](https://github.com/danielsogl/awesome-cordova-plugins/commit/4471806f73ab286bbcab22d28ea2120cb4cc6a2b)), closes [#3491](https://github.com/danielsogl/awesome-cordova-plugins/issues/3491)
* **mobile-messaging:** Added fullFeaturedInApps method to config, fetching of the Inbox methods and registerForRemoteAndroidNotifications method ([#4810](https://github.com/danielsogl/awesome-cordova-plugins/issues/4810)) ([63f2fcb](https://github.com/danielsogl/awesome-cordova-plugins/commit/63f2fcbe99b6be14a76a4a6c72ef19594d82905b))
* **webengage:** New Plugin for Notification Inbox ([#4819](https://github.com/danielsogl/awesome-cordova-plugins/issues/4819)) ([3168688](https://github.com/danielsogl/awesome-cordova-plugins/commit/3168688ce44b1353ed6f12e41e06c90647046f71))
# [6.8.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.7.0...v6.8.0) (2024-07-11)

792
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "awesome-cordova-plugins",
"version": "6.8.0",
"version": "6.9.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://awesome-cordova-plugins.com",
"author": "Daniel Sogl <me@danielsogl.com> (https://danielsogl.com)",
@@ -24,7 +24,7 @@
"prettier": "prettier --write --ignore-unknown \"**/*\""
},
"dependencies": {
"tslib": "2.6.3"
"tslib": "2.7.0"
},
"devDependencies": {
"@angular/common": "12.2.17",
@@ -47,20 +47,20 @@
"dgeni-packages": "0.16.10",
"eslint": "8.57.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-jsdoc": "48.7.0",
"eslint-plugin-jsdoc": "50.2.2",
"fs-extra": "11.2.0",
"gulp": "5.0.0",
"gulp-rename": "2.0.0",
"gulp-replace": "1.1.4",
"husky": "9.0.11",
"husky": "9.1.6",
"is-ci": "3.0.1",
"jest": "27.5.1",
"lint-staged": "15.2.7",
"lint-staged": "15.2.10",
"lodash": "4.17.21",
"minimist": "1.2.8",
"prettier": "2.8.8",
"rimraf": "5.0.5",
"rollup": "4.18.1",
"rollup": "4.21.3",
"rxjs": "6.6.7",
"terser-webpack-plugin": "5.3.10",
"ts-jest": "27.1.5",
@@ -68,7 +68,7 @@
"typescript": "4.2.4",
"unminified-webpack-plugin": "3.0.0",
"webpack": "5.74.0",
"winston": "3.13.1",
"winston": "3.14.2",
"zone.js": "0.11.8"
},
"jest": {

View File

@@ -28,98 +28,6 @@ interface AbortedResponse {
aborted: boolean;
}
export interface ApproovLoggableToken {
/**
* Expiry
* The only mandatory claim for Approov tokens. It specifies the expiry time for the token as a Unix timestamp.
*/
exp: number;
/**
* Device ID
* This claim identifies the device for which the token was issued. This is a base64 encoded string representing a 128-bit device identifier.
* Note that this is not, strictly speaking, a device identifier as it is also influenced by the app identifier
* and may change if the same app is uninstalled and then reinstalled on the same device.
*/
did?: string;
/**
* Attestation Response Code
* This is an optional claim that encodes information about a subset of the device property flags and also whether the attestation was a pass or fail.
* The claim is encoded in base32 and is typically 10 characters long (although it may be longer in some circumstances).
* This claim is not included by tokens from the failover.
*/
arc?: string;
/**
* IP Address
* This holds the IP address of the device as seen by the Approov cloud service. It is provided in a human readable IP address format (in either IPv4 or IPv6 format).
* In practice this value can often change between the time a token is issued and the time it is sent to your backend, so you should never block if it differs, but you may include it as a signal that tokens have somehow been stolen and are being replayed.
* This claim is not included by tokens from the failover or if the IP Tracking Policy for the account has been set to none.
*/
ip?: string;
/**
* Issuer
* An optional claim that is added if the issuer inclusion option is enabled. This provides the Approov account ID that was used to issue the token (suffixed with approov.io).
* It can be used as an additional layer of backend verification if signing keys are shared between multiple accounts.
* It indicates that tokens were issued from the expected Approov account. This claim may also be set to an explicit value for long lived Approov tokens.
* This flexibility is designed for use with server-to-server communication (which may only be signed with the account specific secret keys).
*/
iss?: string;
/**
* Annotation
* This is an embedded JSON array of strings showing the list of flags that are set and are in the annotation set for the security policy that is selected.
* This allows additional information to be collected about the state of a particular device without necessarily causing an attestation failure.
* Note that if there are no possible annotations then this claim is not present at all. This claim is not included by tokens from the failover.
*/
anno?: string[];
/**
* Payload Hash
* An optional claim that is added if the protected app passes a token binding argument to the setDataHashInToken method.
* The claim value is set to the base64 encoded SHA256 hash of the provided payload string.
* This is typically used to bind an Approov token to some other data used by your app to enhance security (like a user auth token).
*/
pay?: string;
/**
* Audience
* An optional claim that is added if the audience inclusion option is enabled. This provides the domain for which the token was issued.
* It can be used as an additional layer of backend verification to ensure that tokens intended for one domain cannot be used on to access a different one.
*/
aud?: string;
/**
* Message Siging Key ID
* This is an optional claim that encodes the ID of a key being used for Message Signing.
* This is only present in Approov tokens for which message signing is active. This claim is not included by tokens from the failover.
*/
mskid?: string;
/**
* Measurement Proof Key
* An optional claim to provide the measurement proof key if a measurement has been requested by the SDK on the domain for which the token is issued.
* This is a base64 encoded 128-bit proof key value. Note that if measurement is being used, then JWE tokens will be used to keep this claim secret.
*/
mpk?: string;
/**
* Integrity Measurement Hash
* An optional claim to provide the integrity measurement hash if a measurement has been requested by the SDK on the domain for which the token is issued.
* This is a base64 encoded 256-bit SHA256 measurement value. Note that if measurement is being used, then JWE tokens will be used to keep this claim secret.
*/
imh?: string;
/**
* Device Measurement Hash
* An optional claim to provide the device measurement hash if a measurement has been requested by the SDK on the domain for which the token is issued.
* This is a base64 encoded 256-bit SHA256 measurement value. Note that if measurement is being used, then JWE tokens will be used to keep this claim secret
*/
dmh?: string;
}
/**
* @name HTTP
* @description
@@ -134,9 +42,9 @@ export interface ApproovLoggableToken {
* we have only added approov functionality on top of it. All credit goes to the actual plugin developer.
* @usage
* ```typescript
* import { ApproovHttp } from '@awesome-cordova-plugins/http/ngx';
* import { HTTP } from '@awesome-cordova-plugins/http/ngx';
*
* constructor(private http: ApproovHttp) {}
* constructor(private http: HTTP) {}
*
* ...
*
@@ -161,14 +69,14 @@ export interface ApproovLoggableToken {
* HTTPResponse
*/
@Plugin({
pluginName: 'ApproovHttp',
plugin: 'cordova-approov-advanced-http',
pluginRef: 'cordova.plugin.ApproovHttp',
repo: 'https://github.com/approov/quickstart-ionic-advancedhttp',
pluginName: 'HTTP',
plugin: '@approov/cordova-plugin-advanced-http',
pluginRef: 'cordova.plugin.http',
repo: 'https://github.com/approov/quickstart-cordova-advancedhttp',
platforms: ['Android', 'iOS'],
})
@Injectable()
export class ApproovHttp extends AwesomeCordovaNativePlugin {
export class HTTP extends AwesomeCordovaNativePlugin {
/**
* This enum represents the internal error codes which can be returned in a HTTPResponse object.
*
@@ -751,13 +659,23 @@ export class ApproovHttp extends AwesomeCordovaNativePlugin {
return;
}
@Cordova({ sync: true })
initializeApproov(): void {
@Cordova({ sync: false })
approovInitialize(config: string): Promise<void> {
return;
}
@Cordova({ sync: true })
approovSetDataHashInToken(dataHash: string): void {
approovSetProceedOnNetworkFail(): void {
return;
}
@Cordova({ sync: false })
approovSetDevKey(devKey: string): Promise<void> {
return;
}
@Cordova({ sync: true })
approovSetTokenHeader(header: string, prefix: string): void {
return;
}
@@ -766,8 +684,73 @@ export class ApproovHttp extends AwesomeCordovaNativePlugin {
return;
}
@Cordova()
getApproovLoggableToken(host: string): Promise<ApproovLoggableToken> {
@Cordova({ sync: true })
approovAddSubstitutionHeader(header: string, requiredPrefix: string): void {
return;
}
@Cordova({ sync: true })
approovRemoveSubstitutionHeader(header: string): void {
return;
}
@Cordova({ sync: true })
approovAddSubstitutionQueryParam(key: string): void {
return;
}
@Cordova({ sync: true })
approovRemoveSubstitutionQueryParam(key: string): void {
return;
}
@Cordova({ sync: true })
approovAddExclusionURLRegex(urlRegex: string): void {
return;
}
@Cordova({ sync: true })
approovRemoveExclusionURLRegex(urlRegex: string): void {
return;
}
@Cordova({ sync: false })
approovPrefetch(): Promise<void> {
return;
}
@Cordova({ sync: false })
approovPrecheck(): Promise<void> {
return;
}
@Cordova({ sync: false })
approovGetDeviceID(): Promise<String> {
return;
}
@Cordova({ sync: false })
approovSetDataHashInToken(data: string): Promise<void> {
return;
}
@Cordova({ sync: false })
approovFetchToken(url: string): Promise<String> {
return;
}
@Cordova({ sync: false })
approovGetMessageSignature(message: string): Promise<String> {
return;
}
@Cordova({ sync: false })
approovFetchSecureString(key: string, newDef: string): Promise<String> {
return;
}
@Cordova({ sync: false })
approovFetchCustomJWT(payload: string): Promise<String> {
return;
}
}

View File

@@ -130,18 +130,6 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
return;
}
/**
* Sets the device's Xiaomi push token.
* clevertap-cordova 2.6.0 onwards method requires region as a mandatory parameter.
* @param token {string}
* @param region {string}
* @returns {Promise<any>}
*/
@Cordova()
setPushXiaomiToken(token: string, region: string): Promise<any> {
return;
}
/**
* Sets the device's Baidu push token
*

View File

@@ -17,7 +17,8 @@ export type Event =
| 'depersonalized'
| 'inAppChat.availabilityUpdated'
| 'inAppChat.unreadMessageCounterUpdated'
| 'deeplink';
| 'deeplink'
| 'inAppChat.viewStateChanged';
export interface CustomEvent {
definitionId: string;
@@ -31,6 +32,7 @@ export interface Configuration {
applicationCode: string;
geofencingEnabled?: boolean;
inAppChatEnabled?: boolean;
fullFeaturedInAppsEnabled?: boolean | undefined;
/**
* Message storage save callback
*/
@@ -167,6 +169,20 @@ export interface Message {
webViewUrl?: string;
inAppOpenTitle?: string | undefined;
inAppDismissTitle?: string;
topic?: string | undefined;
}
export interface MMInbox {
countTotal: number;
countUnread: number;
messages?: Message[] | undefined;
}
export interface MMInboxFilterOptions {
fromDateTime?: string | undefined;
toDateTime?: string | undefined;
topic?: string | undefined;
limit?: number | undefined;
}
export interface MobileMessagingError {
@@ -592,4 +608,55 @@ export class MobileMessaging extends AwesomeCordovaNativePlugin {
resetMessageCounter() {
return;
}
/**
* Registers for Android POST_NOTIFICATIONS permission
* @name registerForAndroidRemoteNotifications
*/
@Cordova()
registerForAndroidRemoteNotifications() {
return;
}
/**
* Fetch mobile inbox data from the server.
*
* @name fetchInboxMessages
* @param token access token (JWT in a strictly predefined format) required for current user to have access to the Inbox messages
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param filterOptions filtering options applied to messages list in response. Nullable, will return default number of messages
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
fetchInboxMessages(token: string, externalUserId: string, filterOptions: MMInboxFilterOptions): Promise<MMInbox> {
return;
}
/**
* Fetch mobile inbox without token from the server.
*
* @name fetchInboxMessagesWithoutToken
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param filterOptions filtering options applied to messages list in response. Nullable, will return default number of messages
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
fetchInboxMessagesWithoutToken(externalUserId: string, filterOptions: MMInboxFilterOptions): Promise<MMInbox> {
return;
}
/**
* Asynchronously marks inbox messages as seen
*
* @param externalUserId External User ID is meant to be an ID of a user in an external (non-Infobip) service
* @param messageIds array of inbox messages identifiers that need to be marked as seen
* @param callback will be called on success
* @param {Function} errorCallback will be called on error
*/
@Cordova()
setInboxMessagesSeen(externalUserId: string, messageIds: string[]): Promise<string[]> {
return;
}
}

View File

@@ -0,0 +1,160 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
/**
* @name WE Cap Inbox
* @description
* This plugin provides functionalities to manage notifications in your app.
*
* @usage
* ```typescript
* import { WECapInbox } from '@awesome-cordova-plugins/we-cap-inbox';
*
* constructor(private wECapInbox: WECapInbox) { }
*
* ...
*
* this.WECapInbox.getNotificationCount()
* .then((count: number) => console.log(count))
* .catch((error: string) => console.error(error));
* ```
*/
@Plugin({
pluginName: 'WECapInbox',
plugin: 'we-notificationinbox-cordova', // npm package name, example: cordova-plugin-camera
pluginRef: 'WENotificationInboxPlugin', // the variable reference to call the plugin,
repo: 'https://github.com/WebEngage/we-ionic-notification-inbox',
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
})
@Injectable()
export class WECapInbox extends AwesomeCordovaNativePlugin {
/**
* Resets the notification count.
* @returns {Promise<void>}
*/
@Cordova()
resetNotificationCount(): Promise<void> {
return;
}
/**
* Retrieves the count of notifications.
* @param {function} successCallback
* @param {function} errorCallback
* @returns {Promise<number>} - The count of notifications.
*/
@Cordova()
getNotificationCount(successCallback: (count: String) => void, errorCallback: (error: string) => void): Promise<any> {
return;
}
/**-
* Retrieves Notification List
* @param {JsonObject | null} offset - Optional offset for notifications
* @param {function} successCallback
* @param {function} errorCallback
* @returns {Promise<any>}
*/
@Cordova()
getNotificationList(
offset: JsonObject | null,
successCallback: (notifications: NotificationResponse) => void,
errorCallback: (error: string) => void
): Promise<any> {
return;
}
/**
* Marks a specific notification as read.
* @param {JsonObject} notificationObject - The notification to mark as read.
* @returns {Promise<void>}
*/
@Cordova()
markRead(notificationObject: JsonObject): Promise<void> {
return;
}
/**
* Marks a specific notification as unread.
* @param {JsonObject} notificationObject - The notification to mark as unread.
* @returns {Promise<void>}
*/
@Cordova()
markUnread(notificationObject: JsonObject): Promise<void> {
return;
}
/**
* Tracks a click event on a notification.
* @param {JsonObject} notificationObject - The notification that was clicked.
* @returns {Promise<void>}
*/
@Cordova()
trackClick(notificationObject: JsonObject): Promise<void> {
return;
}
/**
* Tracks the view event of a notification.
* @param {JsonObject} notificationObject - The notification that was viewed.
* @returns {Promise<void>}
*/
@Cordova()
trackView(notificationObject: JsonObject): Promise<void> {
return;
}
/**
* Marks a specific notification as deleted.
* @param {JsonObject} notificationObject - The notification to delete.
* @returns {Promise<void>}
*/
@Cordova()
markDelete(notificationObject: JsonObject): Promise<void> {
return;
}
/**
* Marks all notifications as read.
* @param {JsonArray} notificationList - An array of notification identifiers to mark as read.
* @returns {Promise<void>}
*/
@Cordova()
readAll(notificationList: JsonArray): Promise<void> {
return;
}
/**
* Marks all notifications as unread.
* @param {JsonArray} notificationList - An array of notification identifiers to mark as unread.
* @returns {Promise<void>}
*/
@Cordova()
unReadAll(notificationList: JsonArray): Promise<void> {
return;
}
/**
* Deletes all notifications.
* @param {JsonArray} notificationList - An array of notification identifiers to delete.
* @returns {Promise<void>}
*/
@Cordova()
deleteAll(notificationList: JsonArray): Promise<void> {
return;
}
}
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
export type NotificationResponse = {
hasNext: boolean;
messageList: JsonArray;
};
export type JsonObject = {
[key: string]: JsonValue;
};
export type JsonArray = JsonValue[];

View File

@@ -7,7 +7,7 @@ import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-pl
* Awesome Cordova Plugins wrapper that wraps Webengage Cordova plugin for Android and iOS
* @usage
* ```typescript
* import { Webengage, WebengageUser, WebengagePush, WebengageNotification } from '@awesome-cordova-plugins/webengage/ngx';
* import { Webengage, WebengageUser, WebengagePush, WebengageNotification, WebengageJwtManager } from '@awesome-cordova-plugins/webengage/ngx';
*
*
* constructor(private webengage: Webengage, private webengageUser: WebengageUser, private webengagePush: WebengagePush, private webengageNotification: WebengageNotification ) { }
@@ -96,7 +96,17 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
login(userId: string): Promise<any> {
login(userId: string, jwtToken?: string): Promise<any> {
return;
}
/**
* Logs user in
* @param {string} userId
* @returns {Promise<any>}
*/
@Cordova()
setSecureToken(userId: string, jwtToken: string): Promise<any> {
return;
}
@@ -140,6 +150,38 @@ export class WebengageUser extends AwesomeCordovaNativePlugin {
setUserOptIn(channel: string, optIn: any): Promise<any> {
return;
}
/**
* Sets user location
* @param {number} latitude
* @param {number} longitude
* @returns {Promise<any>}
*/
@Cordova()
setLocation(latitude: number, longitude: number): Promise<any> {
return;
}
}
/**
* @hidden
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.jwtManager',
})
@Injectable()
export class WebengageJwtManager extends AwesomeCordovaNativePlugin {
/**
* Callback function is invoked when a Jwt token is clicked
* @param {any} callback
* @returns {Promise<any>}
*/
@Cordova()
tokenInvalidatedCallback(callback: any): Promise<any> {
return;
}
}
/**