mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-16 00:00:02 +08:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
499b107c21 | ||
|
|
21e3e37a0d | ||
|
|
eca218a36f | ||
|
|
d38db02f92 | ||
|
|
b6bc20cefe | ||
|
|
0e12d1dc65 | ||
|
|
b5dc553659 | ||
|
|
1337ff5c7e | ||
|
|
14b04b5243 | ||
|
|
740268a75b | ||
|
|
e85f761999 | ||
|
|
acb6ba74fc | ||
|
|
a5ac795ef4 | ||
|
|
e95aa9ea74 | ||
|
|
74c9cd2a66 | ||
|
|
b20c67bf14 | ||
|
|
d83b124cec | ||
|
|
381f012402 | ||
|
|
658a55bc97 | ||
|
|
ac767ab219 | ||
|
|
4b526e4d4d | ||
|
|
da7b13fbcf | ||
|
|
890b8b855c | ||
|
|
9744564c8a | ||
|
|
a99ef76251 | ||
|
|
a97314afd5 | ||
|
|
652431206c | ||
|
|
68abedd15a | ||
|
|
910af256af | ||
|
|
3434bd5dce | ||
|
|
be6000f13c | ||
|
|
e830259beb | ||
|
|
4e817a96a8 | ||
|
|
61d0854f73 | ||
|
|
3a64cd4bcd | ||
|
|
c40a73407d | ||
|
|
bb5b344100 | ||
|
|
f87a73f29d | ||
|
|
bff5cce125 | ||
|
|
8fc3465ed5 | ||
|
|
50287d1f5a | ||
|
|
45fdf7fb3d | ||
|
|
7b24fa8478 | ||
|
|
12d6baed90 | ||
|
|
4c2af62bfa | ||
|
|
f53aea0a47 | ||
|
|
621c5842b9 | ||
|
|
04550843e5 | ||
|
|
6c480237cf | ||
|
|
f86836ab13 | ||
|
|
1c21dd1a77 | ||
|
|
657b31f67b | ||
|
|
3168688ce4 | ||
|
|
5f15119971 | ||
|
|
4471806f73 | ||
|
|
63f2fcbe99 | ||
|
|
5aa432d0a2 | ||
|
|
9569628c67 | ||
|
|
d03b4cc113 | ||
|
|
82be769a16 |
6
.github/workflows/nodejs.yml
vendored
6
.github/workflows/nodejs.yml
vendored
@@ -8,12 +8,12 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4.0.3
|
||||
uses: actions/setup-node@v4.1.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
|
||||
12
.github/workflows/npmpublish.yml
vendored
12
.github/workflows/npmpublish.yml
vendored
@@ -9,10 +9,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- uses: actions/setup-node@v4.0.3
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.1.0
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Build
|
||||
@@ -24,10 +24,10 @@ jobs:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.7
|
||||
- uses: actions/setup-node@v4.0.3
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.1.0
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm run shipit
|
||||
|
||||
71
CHANGELOG.md
71
CHANGELOG.md
@@ -1,3 +1,74 @@
|
||||
# [6.13.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.12.0...v6.13.0) (2024-12-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **clevertap:** support clevertap-cordova 3.3.0 ([#4883](https://github.com/danielsogl/awesome-cordova-plugins/issues/4883)) ([21e3e37](https://github.com/danielsogl/awesome-cordova-plugins/commit/21e3e37a0df0b099e857ff5eb0330a1ee5b6fe12)), closes [#3491](https://github.com/danielsogl/awesome-cordova-plugins/issues/3491)
|
||||
|
||||
|
||||
|
||||
# [6.12.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.11.0...v6.12.0) (2024-11-21)
|
||||
|
||||
|
||||
|
||||
# [6.11.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.10.0...v6.11.0) (2024-11-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **cordova-plugin-firebase-model:** updated to @awesome-cordova-plugins/core ([#4858](https://github.com/danielsogl/awesome-cordova-plugins/issues/4858)) ([ac767ab](https://github.com/danielsogl/awesome-cordova-plugins/commit/ac767ab2198ab55d3cfcc20fafab838301e6f051))
|
||||
* **deps:** update dependency tslib to v2.8.1 ([#4856](https://github.com/danielsogl/awesome-cordova-plugins/issues/4856)) [skip ci] ([4b526e4](https://github.com/danielsogl/awesome-cordova-plugins/commit/4b526e4d4d96651baf126724909b034c7b25eac2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cordova-plugin-iroot:** add plugin ([#4857](https://github.com/danielsogl/awesome-cordova-plugins/issues/4857)) ([658a55b](https://github.com/danielsogl/awesome-cordova-plugins/commit/658a55bc97dd4247ed8e8672ae08c23df2fdb185))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat(in-app-purchase-3) new InAppPurchase3 plugin (#4849)" (#4871) ([6524312](https://github.com/danielsogl/awesome-cordova-plugins/commit/652431206c51f5f66e88786d4bffa4ccca6331b3)), closes [#4849](https://github.com/danielsogl/awesome-cordova-plugins/issues/4849) [#4871](https://github.com/danielsogl/awesome-cordova-plugins/issues/4871)
|
||||
|
||||
|
||||
|
||||
# [6.10.0](https://github.com/danielsogl/awesome-cordova-plugins/compare/v6.9.0...v6.10.0) (2024-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **in-app-browser:** remove duplicated method ([#4838](https://github.com/danielsogl/awesome-cordova-plugins/issues/4838)) ([3a64cd4](https://github.com/danielsogl/awesome-cordova-plugins/commit/3a64cd4bcdf18b9a776ab90b45faf59c9a3ca10c))
|
||||
* **screenshot:** Update plugin NPM package name ([#4844](https://github.com/danielsogl/awesome-cordova-plugins/issues/4844)) ([4e817a9](https://github.com/danielsogl/awesome-cordova-plugins/commit/4e817a96a876d9adb6ffdbe6163f7e19ec1670d2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **adjust:** update adjust sdk index.ts api to v5.0.0 ([#4826](https://github.com/danielsogl/awesome-cordova-plugins/issues/4826)) ([50287d1](https://github.com/danielsogl/awesome-cordova-plugins/commit/50287d1f5a94b8e311f541040f3034568646b3b3))
|
||||
* **bluetooth-classic-serial-port:** add method initialize ([#4847](https://github.com/danielsogl/awesome-cordova-plugins/issues/4847)) ([e830259](https://github.com/danielsogl/awesome-cordova-plugins/commit/e830259bebdb20a5dfef9d8bde4dde7cb84cfae2))
|
||||
* **intercom:** add support cordova-intercom v14+ ([#4839](https://github.com/danielsogl/awesome-cordova-plugins/issues/4839)) ([61d0854](https://github.com/danielsogl/awesome-cordova-plugins/commit/61d0854f73ec0c59cd528951b168cc7f3e88c8d0))
|
||||
* **network-permission:** add plugin ([#4830](https://github.com/danielsogl/awesome-cordova-plugins/issues/4830)) ([bff5cce](https://github.com/danielsogl/awesome-cordova-plugins/commit/bff5cce12555292d678539ed4690ec6ac79b8481))
|
||||
* **shortcuts-android:** add plugin ([#4831](https://github.com/danielsogl/awesome-cordova-plugins/issues/4831)) ([f87a73f](https://github.com/danielsogl/awesome-cordova-plugins/commit/f87a73f29d28dd0a0b3236540945bc97e4db5ddd))
|
||||
* **sockets-tcp:** add plugin ([#4833](https://github.com/danielsogl/awesome-cordova-plugins/issues/4833)) ([bb5b344](https://github.com/danielsogl/awesome-cordova-plugins/commit/bb5b3441005f9b564390de75cec8313eea9db50a))
|
||||
* **sockets-udp:** add plugin ([#4832](https://github.com/danielsogl/awesome-cordova-plugins/issues/4832)) ([c40a734](https://github.com/danielsogl/awesome-cordova-plugins/commit/c40a73407d7dde06e1e450c5c658220e275b643b))
|
||||
|
||||
|
||||
|
||||
# [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)
|
||||
|
||||
|
||||
|
||||
36
docs/plugins/i-root/README.md
Normal file
36
docs/plugins/i-root/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# IRoot
|
||||
|
||||
```text
|
||||
$ ionic cordova plugin add cordova-plugin-iroot
|
||||
$ npm install @awesome-cordova-plugins/i-root
|
||||
```
|
||||
|
||||
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/iroot/)
|
||||
|
||||
Plugin Repo: [https://github.com/WuglyakBolgoink/cordova-plugin-iroot](https://github.com/WuglyakBolgoink/cordova-plugin-iroot)
|
||||
|
||||
Use this plugin to add an extra layer of security for your app by detecting if the device was rooted (on android) or jailbreaked (on iOS).
|
||||
|
||||
## Supported platforms
|
||||
|
||||
* Android
|
||||
* iOS
|
||||
|
||||
## Original Plugin Notes
|
||||
|
||||
### iOS - Postinstall
|
||||
|
||||
To avoid errors like
|
||||
|
||||
> -canOpenURL: failed for URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"
|
||||
|
||||
don’t forget to add `"cydia"` in `LSApplicationQueriesSchemes` key of `info.plist`. Otherwise `canOpenURL` will always return `false`.
|
||||
|
||||
```xml
|
||||
<xxx>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>cydia</string>
|
||||
</array>
|
||||
</xxx>
|
||||
```
|
||||
1306
package-lock.json
generated
1306
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "awesome-cordova-plugins",
|
||||
"version": "6.8.0",
|
||||
"version": "6.13.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.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/common": "12.2.17",
|
||||
@@ -45,30 +45,30 @@
|
||||
"cz-conventional-changelog": "3.3.0",
|
||||
"dgeni": "0.4.14",
|
||||
"dgeni-packages": "0.16.10",
|
||||
"eslint": "8.57.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-config-prettier": "8.10.0",
|
||||
"eslint-plugin-jsdoc": "48.7.0",
|
||||
"eslint-plugin-jsdoc": "50.6.1",
|
||||
"fs-extra": "11.2.0",
|
||||
"gulp": "5.0.0",
|
||||
"gulp-rename": "2.0.0",
|
||||
"gulp-replace": "1.1.4",
|
||||
"husky": "9.0.11",
|
||||
"is-ci": "3.0.1",
|
||||
"husky": "9.1.7",
|
||||
"is-ci": "4.1.0",
|
||||
"jest": "27.5.1",
|
||||
"lint-staged": "15.2.7",
|
||||
"lint-staged": "15.2.11",
|
||||
"lodash": "4.17.21",
|
||||
"minimist": "1.2.8",
|
||||
"prettier": "2.8.8",
|
||||
"rimraf": "5.0.5",
|
||||
"rollup": "4.18.1",
|
||||
"rollup": "4.28.1",
|
||||
"rxjs": "6.6.7",
|
||||
"terser-webpack-plugin": "5.3.10",
|
||||
"terser-webpack-plugin": "5.3.11",
|
||||
"ts-jest": "27.1.5",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "4.2.4",
|
||||
"unminified-webpack-plugin": "3.0.0",
|
||||
"webpack": "5.74.0",
|
||||
"winston": "3.13.1",
|
||||
"winston": "3.17.0",
|
||||
"zone.js": "0.11.8"
|
||||
},
|
||||
"jest": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,16 @@ export interface BluetoothClassicSerialPortDevice {
|
||||
})
|
||||
@Injectable()
|
||||
export class BluetoothClassicSerialPort extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
initialize(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to a Bluetooth device
|
||||
*
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -674,6 +662,17 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all types of files which are preloaded for SDK features like custom in-app templates, app functions and variables etc.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches In Apps from server.
|
||||
*
|
||||
@@ -1144,6 +1143,16 @@ export class CleverTap extends AwesomeCordovaNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create File Variable
|
||||
* @returns {Promise<any>}
|
||||
* @param {string} variable The String specifying the name of file varible to be created.
|
||||
*/
|
||||
@Cordova()
|
||||
defineFileVariable(variable: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a variable or a group for the specified name.
|
||||
* @param {string} name - name.
|
||||
@@ -1182,6 +1191,177 @@ 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
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
onFileValueChanged(name: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a callback to be invoked when variables are initialised with server values. Will be called only once on app start, or when added if server values are already received
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
onOneTimeVariablesChanged(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a callback to be invoked when no files need to be downloaded or all downloads have been completed. It is called each time new values are fetched and downloads are completed.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
onVariablesChangedAndNoDownloadsPending(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a callback to be invoked only once for when new values are fetched and downloaded
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
onceVariablesChangedAndNoDownloadsPending(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/****************************
|
||||
* Custom Templates methods
|
||||
****************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Uploads Custom in-app templates and app functions to the server. Requires Development/Debug build/configuration.
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
syncCustomTemplates(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads Custom in-app templates and app functions to the server.
|
||||
* @param {boolean} isProduction Provide `true` if templates must be sync in Productuon build/configuration.
|
||||
* @returns {Promise<any>}
|
||||
*
|
||||
*
|
||||
* Note: This is NO-OP in Android
|
||||
*/
|
||||
@Cordova()
|
||||
syncCustomTemplatesInProd(isProduction: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@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>}
|
||||
*/
|
||||
@Cordova()
|
||||
customTemplateContextToString(templateName: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Android 13 Push Primer
|
||||
****************************/
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
Plugin,
|
||||
Cordova,
|
||||
CordovaProperty,
|
||||
CordovaInstance,
|
||||
InstanceProperty,
|
||||
IonicNativePlugin,
|
||||
} from '@ionic-native/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export enum FirebaseModelStatus {
|
||||
@@ -93,7 +86,7 @@ export class FirebaseModelInput {
|
||||
platforms: ['iOS'], // Array of platforms supported, example: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseModel extends IonicNativePlugin {
|
||||
export class FirebaseModel extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* This function configure the Firebase TFLite model and downloads.
|
||||
* @param {string} arg1 Name of the TFLite model which is uploaded in the Firebase console
|
||||
|
||||
54
src/@awesome-cordova-plugins/plugins/i-root/index.ts
Normal file
54
src/@awesome-cordova-plugins/plugins/i-root/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
|
||||
|
||||
/**
|
||||
* @name IRoot
|
||||
* @description
|
||||
* Use this plugin to add an extra layer of security for your app by detecting if the device was rooted (on android) or jailbreaked (on iOS).
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { IRoot } from '@awesome-cordova-plugins/i-root';
|
||||
*
|
||||
* constructor(private iRoot: IRoot) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.iRoot.isRooted()
|
||||
* .then((res: boolean) => console.log('is rooted?', res))
|
||||
* .catch((error: string) => console.error(error));
|
||||
*
|
||||
* this.iRoot.isRootedWithBusyBox()
|
||||
* .then((res: boolean) => console.log('is rooted?', res))
|
||||
* .catch((error: string) => console.error(error));
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'IRoot',
|
||||
plugin: 'cordova-plugin-IRoot',
|
||||
pluginRef: 'IRoot',
|
||||
repo: 'https://github.com/WuglyakBolgoink/cordova-plugin-IRoot',
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class IRoot extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Checks if the device is rooted/jailbroken.
|
||||
* @return {Promise<boolean>} Resolves to true if the device is Jailbroken/rooted, otherwise false.
|
||||
*/
|
||||
@Cordova()
|
||||
isRooted(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Android only! Checks if the device was rooted via busybox.
|
||||
* @return {Promise<boolean>} Resolves to true if the device is Jailbroken/rooted, otherwise false.
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['android'],
|
||||
})
|
||||
isRootedWithBusyBox(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,8 @@ export type InAppBrowserEventType =
|
||||
| 'exit'
|
||||
| 'beforeload'
|
||||
| 'message'
|
||||
| 'customscheme';
|
||||
| 'customscheme'
|
||||
| string
|
||||
|
||||
export interface InAppBrowserEvent extends Event {
|
||||
/** the event name */
|
||||
@@ -245,19 +246,6 @@ export class InAppBrowserObject {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A method that allows you to listen to events happening in the browser.
|
||||
*
|
||||
* @param event {string} Name of the event
|
||||
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
|
||||
*/
|
||||
@InstanceCheck()
|
||||
on(event: string): Observable<InAppBrowserEvent> {
|
||||
return new Observable<InAppBrowserEvent>((observer: Observer<InAppBrowserEvent>) => {
|
||||
this._objectInstance.addEventListener(event, observer.next.bind(observer));
|
||||
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -248,6 +248,9 @@ export class IAPError {
|
||||
* - **macOS** version 10
|
||||
* - **Xbox One**
|
||||
* - (and any platform supporting Microsoft's UWP)
|
||||
* - **cordova-plugin-purchase** version 12 or lower.
|
||||
* @see https://github.com/j3k0/cordova-plugin-purchase/wiki/HOWTO:-Migrate-to-v13 For cordova-plugin-purchase versions
|
||||
* 13 and higher, use awesome cordova plugin InAppPurchase3 instead
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
|
||||
|
||||
1259
src/@awesome-cordova-plugins/plugins/in-app-purchase-3/index.ts
Normal file
1259
src/@awesome-cordova-plugins/plugins/in-app-purchase-3/index.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ import { Injectable } from '@angular/core';
|
||||
* @name Intercom
|
||||
* @description
|
||||
* This is a plugin that allows your Ionic app to use Intercom for iOS and/or Intercom for Android.
|
||||
* Follow the offical documentation to setup this plugin correctly: https://developers.intercom.com/docs/cordova-phonegap-configuration
|
||||
* Follow the offical documentation to setup this plugin correctly: https://developers.intercom.com/installing-intercom/cordova-phonegap/installation
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Intercom } from '@awesome-cordova-plugins/intercom/ngx';
|
||||
@@ -31,196 +31,282 @@ import { Injectable } from '@angular/core';
|
||||
@Injectable()
|
||||
export class Intercom extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Register a identified user
|
||||
*
|
||||
* @param options {any} Options
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Login a user with identifiable information.
|
||||
* Valid identifiers are `userId` and `email` which must be set in an object.
|
||||
* @param options The object that contains the user's `email` or `userId`.
|
||||
*/
|
||||
@Cordova()
|
||||
registerIdentifiedUser(options: any): Promise<any> {
|
||||
loginUserWithUserAttributes(options: IntercomLoginUserAttributes): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a unidentified user
|
||||
*
|
||||
* @param options {any} Options
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Login a unidentified user.
|
||||
* This is a user that doesn't have any identifiable information such as a `userId` or `email`.
|
||||
*/
|
||||
@Cordova()
|
||||
registerUnidentifiedUser(options: any): Promise<any> {
|
||||
loginUnidentifiedUser(options: { [key: string]: number | string }): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* This resets the Intercom integration's cache of your user's identity and wipes the slate clean.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Log a user out of their Intercom session.
|
||||
* This will dismiss any Intercom UI and clear Intercom's local cache.
|
||||
*/
|
||||
@Cordova()
|
||||
reset(): Promise<any> {
|
||||
logout(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set `hash` string if you are using Identity Verification for your Intercom workspace.
|
||||
* @note This should be called before any user login takes place.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Identity Verification helps to make sure that conversations between you and your users are kept private, and that one
|
||||
* user can't impersonate another. If Identity Verification is enabled for your app, Intercom will sign all requests
|
||||
* going to the Intercom servers with tokens. It requires your mobile application to have its own server which authenticates the app's users,
|
||||
* and which can store a secret.
|
||||
*
|
||||
* @see More information on Identity Verification can be found {@link https://developers.intercom.com/installing-intercom/cordova-phonegap/identity-verification/ here}
|
||||
* @param secureHash A HMAC digest of the user ID or email.
|
||||
*/
|
||||
@Cordova()
|
||||
logout(): Promise<any> {
|
||||
setUserHash(secureHash: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a user in Intercom with data specified in an object.
|
||||
*
|
||||
* @param secureHash {string}
|
||||
* @param secureData {any}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @deprecated Use setUserHash instead as of Intercom Cordova 4.0.0 and higher https://github.com/intercom/intercom-cordova/blob/master/CHANGELOG.md#400-2017-08-29
|
||||
* @param attributes The object with the user data.
|
||||
*/
|
||||
@Cordova()
|
||||
setSecureMode(secureHash: string, secureData: any): Promise<any> {
|
||||
updateUser(attributes: IntercomUserAttributes): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log an event with a given name and metaData.
|
||||
* You can log events in Intercom based on user actions in your app.
|
||||
*
|
||||
* @param secureHash {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param eventName The name of the event.
|
||||
* @param metaData Metadata Objects support a few simple types that Intercom can present on your behalf,
|
||||
* @see https://developers.intercom.com/docs/references/rest-api/api.intercom.io/Data-Events/data_event/ Intercom API docs
|
||||
*/
|
||||
@Cordova()
|
||||
setUserHash(secureHash: string): Promise<any> {
|
||||
logEvent(eventName: string, metaData: IntercomEventMetaData): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param attributes {any}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Present Intercom as a modal overlay in your app.
|
||||
* The `Home` space is displayed by default.
|
||||
*/
|
||||
@Cordova()
|
||||
updateUser(attributes: any): Promise<any> {
|
||||
present(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present an Intercom `space` as a modal overlay in your app
|
||||
* @see {@link Space} for a list of valid spaces.
|
||||
*
|
||||
* @param eventName {string}
|
||||
* @param metaData {any}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param space The Intercom space to be presented.
|
||||
*/
|
||||
@Cordova()
|
||||
logEvent(eventName: string, metaData: any): Promise<any> {
|
||||
presentSpace(space: IntercomSpace): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present Intercom content.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* An IntercomContent object.
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessenger(): Promise<any> {
|
||||
presentContent(content: IntercomPresentContent): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Present the message composer.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param initialMessage An optional message that is used to pre-populate the composer with some text.
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessageComposer(): Promise<any> {
|
||||
presentMessageComposer(initialMessage: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch all Help Center collections.
|
||||
*
|
||||
* @param initialMessage {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @return An array of HelpCenterCollection objects.
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessageComposerWithInitialMessage(initialMessage: string): Promise<any> {
|
||||
fetchHelpCenterCollections(): Promise<IntercomHelpCenterCollectionContent[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the contents of a Help Center collection.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param collectionId The ID of the Help Center collection.
|
||||
*
|
||||
* @return A HelpCenterCollectionContent object.
|
||||
*/
|
||||
@Cordova()
|
||||
displayConversationsList(): Promise<any> {
|
||||
fetchHelpCenterCollection(collectionId: string): Promise<IntercomHelpCenterCollectionContent> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search the Help Center.
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param searchTerm The search term.
|
||||
*
|
||||
* @return An array of HelpCenterArticleSearchResult objects.
|
||||
*/
|
||||
@Cordova()
|
||||
displayHelpCenter(): Promise<any> {
|
||||
searchHelpCenter(searchTerm: string): Promise<IntercomHelpCenterArticleSearchResult> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Fetch the current number of unread conversations for the logged in User.
|
||||
* @return The number of unread conversations.
|
||||
*/
|
||||
@Cordova()
|
||||
unreadConversationCount(): Promise<any> {
|
||||
unreadConversationCount(): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide the Intercom Launcher in your app.
|
||||
* @note The Launcher is hidden by default.
|
||||
*
|
||||
* @param visibility {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param visibility A boolean indicating if the Intercom Launcher should be visible.
|
||||
*/
|
||||
@Cordova()
|
||||
setLauncherVisibility(visibility: string): Promise<any> {
|
||||
setLauncherVisibility(visibility: IntercomVisibility): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide the Intercom InApp Messages in your app.
|
||||
* @note All InApp Messages are visible by default.
|
||||
*
|
||||
* @param visibility {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @param visibility A boolean indicating if the InApps should be visible.
|
||||
*/
|
||||
@Cordova()
|
||||
setInAppMessageVisibility(visibility: string): Promise<any> {
|
||||
setInAppMessageVisibility(visibility: IntercomVisibility): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Hide all Intercom windows that are currently displayed.
|
||||
* This will hide the Messenger, Help Center, Articles, and in-product messages (eg. Mobile Carousels, chats, and posts).
|
||||
*/
|
||||
@Cordova()
|
||||
hideMessenger(): Promise<any> {
|
||||
hideIntercom(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Set a fixed bottom padding for in app messages and the Intercom Launcher.
|
||||
* @param bottomPadding The size of the bottom padding in points.
|
||||
*/
|
||||
@Cordova()
|
||||
registerForPush(): Promise<any> {
|
||||
setBottomPadding(bottomPadding: number): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param token {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* Register for push notifications
|
||||
* @note This function is only available for iOS.
|
||||
*/
|
||||
@Cordova()
|
||||
sendPushTokenToIntercom(token: string): Promise<any> {
|
||||
registerForPush(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a device token to Intercom to enable push notifications to be sent to the User.
|
||||
* @param token The device token to send to the server.
|
||||
*
|
||||
* @param carouselId {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @note This function is only available for Android.
|
||||
*/
|
||||
@Cordova()
|
||||
sendPushTokenToIntercom(token: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
registerIdentifiedUser(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
registerUnidentifiedUser(options: any): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
reset(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessenger(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayHelpCenter(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessageComposerWithInitialMessage(initialMessage: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayMessageComposer(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayHelpCenterCollections(collectionIds: string[]): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayCarousel(carouselId: string): Promise<any> {
|
||||
@@ -228,9 +314,7 @@ export class Intercom extends AwesomeCordovaNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param articleId {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displayArticle(articleId: string): Promise<any> {
|
||||
@@ -238,22 +322,80 @@ export class Intercom extends AwesomeCordovaNativePlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bottomPadding {string | number}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
*/
|
||||
@Cordova()
|
||||
setBottomPadding(bottomPadding: string | number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Programmatically display a Survey
|
||||
* @param surveyId {string}
|
||||
* @returns {Promise<any>} Returns a promise
|
||||
* @deprecated
|
||||
*/
|
||||
@Cordova()
|
||||
displaySurvey(surveyId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
export enum IntercomVisibility {
|
||||
VISIBLE = 'VISIBLE',
|
||||
GONE = 'GONE',
|
||||
}
|
||||
|
||||
export enum IntercomSpace {
|
||||
Home = 'HOME',
|
||||
HelpCenter = 'HELP_CENTER',
|
||||
Messages = 'MESSAGES',
|
||||
Tickets = 'TICKETS',
|
||||
}
|
||||
|
||||
export interface IntercomHelpCenterCollectionContent {
|
||||
collectionId: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
articles: any[];
|
||||
sections: any[];
|
||||
}
|
||||
|
||||
export enum IntercomPresentContentType {
|
||||
Article = 'ARTICLE',
|
||||
Carousel = 'CAROUSEL',
|
||||
Survey = 'SURVEY',
|
||||
HelpCenterCollections = 'HELP_CENTER_COLLECTIONS',
|
||||
Conversation = 'CONVERSATION',
|
||||
}
|
||||
|
||||
export type IntercomPresentContent =
|
||||
| { id: string; type: IntercomPresentContentType }
|
||||
| { ids: string[]; type: IntercomPresentContentType };
|
||||
|
||||
export interface IntercomUserAttributes {
|
||||
email?: string;
|
||||
user_id?: string;
|
||||
name?: string;
|
||||
phone?: string;
|
||||
language_override?: string;
|
||||
signed_up_at?: string;
|
||||
unsubscribed_from_emails?: string;
|
||||
custom_attributes?: string;
|
||||
companies?: string[];
|
||||
}
|
||||
|
||||
export interface IntercomEventMetaData {
|
||||
created_at: string;
|
||||
type?: string;
|
||||
metadata?: any;
|
||||
[key: string]: number | string | { [key: string]: number | string };
|
||||
}
|
||||
|
||||
export type IntercomLoginUserAttributes =
|
||||
| {
|
||||
email: string;
|
||||
}
|
||||
| {
|
||||
userId: string;
|
||||
}
|
||||
| {
|
||||
email: string;
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export interface IntercomHelpCenterArticleSearchResult {
|
||||
articleId: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
matchingSnippet: string;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
|
||||
|
||||
/**
|
||||
* @name Network Permission
|
||||
* @description
|
||||
* Requires Cordova plugin: cordova-plugin-network-permission. For more info, please see the [Network permission plugin docs](https://github.com/j5int/cordova-plugin-network-permission).
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { NetworkPermission } from '@awesome-cordova-plugins/network-permission/ngx';
|
||||
*
|
||||
* constructor(private networkPermission: NetworkPermission) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.networkPermission.requestLocalNetworkPermission()
|
||||
* .then(() => {
|
||||
* console.log('Permission was granted successful');
|
||||
* })
|
||||
* .catch(() => {
|
||||
* console.log('Permission declined');
|
||||
* });
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'NetworkPermission',
|
||||
plugin: 'cordova-plugin-network-permission',
|
||||
pluginRef: 'localNetworkPermission',
|
||||
repo: 'https://github.com/j5int/cordova-plugin-network-permission',
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class NetworkPermission extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Request local network permission
|
||||
*
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
requestLocalNetworkPermission(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ declare const navigator: any;
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Screenshot',
|
||||
plugin: '@herdwatch-apps/cordova-plugin-screenshot',
|
||||
plugin: '@herdwatch/cordova-plugin-screenshot',
|
||||
pluginRef: 'navigator.screenshot',
|
||||
repo: 'https://github.com/herdwatch-apps/cordova-plugin-screenshot',
|
||||
platforms: ['Android', 'iOS'],
|
||||
|
||||
144
src/@awesome-cordova-plugins/plugins/shortcuts-android/index.ts
Normal file
144
src/@awesome-cordova-plugins/plugins/shortcuts-android/index.ts
Normal file
@@ -0,0 +1,144 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-plugins/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export interface Intent {
|
||||
// Defaults to currently running activity
|
||||
activityClass?: string;
|
||||
|
||||
// Defaults to currently running package
|
||||
activityPackage?: string;
|
||||
|
||||
// Defaults to ACTION_VIEW
|
||||
action?: string;
|
||||
|
||||
// Defaults to FLAG_ACTIVITY_NEW_TASK + FLAG_ACTIVITY_CLEAR_TOP
|
||||
flags?: number;
|
||||
|
||||
categories?: string[];
|
||||
|
||||
data?: string;
|
||||
|
||||
extras?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface Shortcut {
|
||||
id: string;
|
||||
shortLabel?: string;
|
||||
longLabel?: string;
|
||||
iconFromResource?: string;
|
||||
iconBitmap?: string;
|
||||
intent?: Intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name ShortcutsAndroid
|
||||
* @description
|
||||
* Use this plugin to create shortcuts in Android. Use this plugin to handle Intents on your application.
|
||||
* For more information on Android App Shortcuts: https://developer.android.com/guide/topics/ui/shortcuts.html
|
||||
* For more information on Android Intents: https://developer.android.com/guide/components/intents-filters.html
|
||||
*
|
||||
* The work that went into creating this plug-in was inspired by the existing plugins: cordova-plugin-shortcut and cordova-plugin-webintent2.
|
||||
*
|
||||
* @usage
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
*
|
||||
* ```typescript
|
||||
* import { ShortcutsAndroid } from '@ionic-native/shortcuts-android/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private shortcutsAndroid: ShortcutsAndroid) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.shortcutsAndroid.supportsDynamic()
|
||||
* .then((supported: boolean) => console.log(`Dynamic shortcuts are ${supported ? '' : 'not'} supported`))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ShortcutsAndroid',
|
||||
plugin: 'cordova-plugin-shortcuts-android',
|
||||
pluginRef: 'plugins.Shortcuts',
|
||||
repo: 'https://github.com/avargaskun/cordova-plugin-shortcuts-android',
|
||||
platforms: ['Android'],
|
||||
})
|
||||
@Injectable()
|
||||
export class ShortcutsAndroid extends AwesomeCordovaNativePlugin {
|
||||
/**
|
||||
* Checking if Dynamic Shortcuts are supported
|
||||
*
|
||||
* Dynamic shortcuts require SDK 25 or later. Use supportsDynamic to check whether the current device meets those requirements.
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if dynamic shortcuts are supported
|
||||
*/
|
||||
@Cordova()
|
||||
supportsDynamic(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checking if Pinned Shortcuts are supported
|
||||
*
|
||||
* Pinned shortcuts require SDK 26 or later. Use supportsPinned to check whether the current device meets those requirements.
|
||||
* @return {Promise<boolean>} returns a promise that resolves with a boolean that indicates if pinned shortcuts are supported
|
||||
*/
|
||||
@Cordova()
|
||||
supportsPinned(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the application Dynamic Shortcuts
|
||||
*
|
||||
* Use `setDynamic` to set the Dynamic Shortcuts for the application, all at once. The shortcuts provided as a parameter will override any existing shortcut. Use an empty array to clear out existing shortcuts.
|
||||
* @return {Promise<void>}
|
||||
* @param shortcuts
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2,
|
||||
})
|
||||
setDynamic(shortcuts: Shortcut[]): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adding a Pinned Shortcut to the launcher
|
||||
*
|
||||
* Use `addPinned` to add a new Pinned Shortcut to the launcher.
|
||||
* @param {Shortcut[]} [shortcut] Array of shortcuts to add.
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2,
|
||||
})
|
||||
addPinned(shortcut: Shortcut): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Querying current Intent
|
||||
*
|
||||
* Use `getIntent` to get the Intent that was used to launch the current instance of the Cordova activity.
|
||||
* @return {Promise<Intent>} returns the Intent that was used to launch the current instance of the Cordova activity
|
||||
*/
|
||||
@Cordova()
|
||||
getIntent(): Promise<Intent> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to new Intents
|
||||
*
|
||||
* Use onNewIntent to trigger your code every time a new Intent is sent to your Cordova activity. Note that in some conditions this subscription may not be executed.
|
||||
* @return {Observable<Intent>} emits the new Intent each time a shortcut is activated
|
||||
*/
|
||||
@Cordova({
|
||||
observable: true,
|
||||
})
|
||||
onNewIntent(): Observable<Intent> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
269
src/@awesome-cordova-plugins/plugins/sockets-tcp/index.ts
Normal file
269
src/@awesome-cordova-plugins/plugins/sockets-tcp/index.ts
Normal file
@@ -0,0 +1,269 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin, CordovaProperty } from '@awesome-cordova-plugins/core';
|
||||
import { Observable, fromEventPattern } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
|
||||
/**
|
||||
* @name SocketsTcp
|
||||
* @description
|
||||
* This plugin provides TCP client sockets for Android and iOS.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SocketsTcp } from '@awesome-cordova-plugins/sockets-tcp/ngx';
|
||||
*
|
||||
* constructor(private socketsTcp: SocketsTcp) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.platform.ready().then(() => {
|
||||
* this.socketsTcp.getSockets()
|
||||
* .then((result: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* })
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SocketsTcp',
|
||||
plugin: 'cordova-plugin-chrome-apps-sockets-tcp',
|
||||
pluginRef: 'chrome.sockets.tcp',
|
||||
repo: 'https://github.com/KoenLav/cordova-plugin-chrome-apps-sockets-tcp',
|
||||
install: 'ionic cordova plugin add https://github.com/KoenLav/cordova-plugin-chrome-apps-sockets-tcp',
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class SocketsTcp extends AwesomeCordovaNativePlugin {
|
||||
@CordovaProperty()
|
||||
onReceive: SocketTcpEvent;
|
||||
|
||||
@CordovaProperty()
|
||||
onReceiveError: SocketTcpEvent;
|
||||
|
||||
/**
|
||||
* @param properties
|
||||
*/
|
||||
@Cordova()
|
||||
create(properties: any): Promise<SocketTcpInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param properties
|
||||
*/
|
||||
@Cordova()
|
||||
update(socketId: number, properties: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param paused
|
||||
*/
|
||||
@Cordova()
|
||||
setPaused(socketId: number, paused: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param enabled
|
||||
* @param delay
|
||||
*/
|
||||
@Cordova()
|
||||
setKeepAlive(socketId: number, enabled: boolean, delay: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param noDelay
|
||||
*/
|
||||
@Cordova({
|
||||
platforms: ['Android'],
|
||||
})
|
||||
setNoDelay(socketId: number, noDelay: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param peerAddress
|
||||
* @param peerPort
|
||||
*/
|
||||
@Cordova()
|
||||
connect(socketId: number, peerAddress: string, peerPort: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
disconnect(socketId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
secure(socketId: number, options: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param data
|
||||
*/
|
||||
@Cordova()
|
||||
send(socketId: number, data: ArrayBuffer): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
close(socketId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
getInfo(socketId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
getSockets(): Promise<SocketTcpInfo[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param options
|
||||
*/
|
||||
@Cordova()
|
||||
pipeToFile(socketId: number, options: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch all incoming data event
|
||||
*/
|
||||
public onReceiveData(): Observable<SocketTcpDataInfo> {
|
||||
return fromEventPattern(
|
||||
(eventHandler) => this.onReceive.addListener(eventHandler),
|
||||
(errorEventHandler) => this.onReceive.removeListener(errorEventHandler)
|
||||
).pipe(
|
||||
map((socketUdpDataInfo: SocketTcpDataInfo) => {
|
||||
socketUdpDataInfo.dataAsSting = socketUdpDataInfo.data
|
||||
? new TextDecoder().decode(socketUdpDataInfo.data).trim()
|
||||
: null;
|
||||
return socketUdpDataInfo;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch socket incoming data
|
||||
* @param socketId
|
||||
*/
|
||||
public onReceiveDataBySocketId(socketId: number) {
|
||||
return this.onReceiveData().pipe(filter((socketDataInfo) => socketDataInfo.socketId === socketId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch all sockets incoming error event listener
|
||||
*/
|
||||
public onReceiveDataError(): Observable<SocketTcpErrorInfo> {
|
||||
return fromEventPattern(
|
||||
(eventHandler) => this.onReceiveError.addListener(eventHandler),
|
||||
(errorEventHandler) => this.onReceiveError.removeListener(errorEventHandler)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch socket incoming error event listener
|
||||
* @param socketId
|
||||
*/
|
||||
public onReceiveDataErrorBySocketId(socketId: number) {
|
||||
return this.onReceiveDataError().pipe(filter((socketDataInfo) => socketDataInfo.socketId === socketId));
|
||||
}
|
||||
}
|
||||
|
||||
export interface SocketTcpInfo {
|
||||
socketId: number;
|
||||
persistent?: boolean;
|
||||
bufferSize?: number;
|
||||
connected?: boolean;
|
||||
name?: string;
|
||||
paused?: boolean;
|
||||
localAddress?: string;
|
||||
localPort?: number;
|
||||
peerAddress?: string;
|
||||
peerPort?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface SocketTcpDataInfo {
|
||||
socketId: number;
|
||||
uri: string;
|
||||
bytesRead: number;
|
||||
data: ArrayBuffer;
|
||||
dataAsSting: string;
|
||||
}
|
||||
|
||||
export interface SocketTcpErrorInfo {
|
||||
message: string;
|
||||
resultCode: SocketTcpErrorResultCode;
|
||||
socketId: number;
|
||||
e?: boolean;
|
||||
}
|
||||
|
||||
export enum SocketTcpErrorResultCode {
|
||||
SocketClosedByServer = 1,
|
||||
ConnectionTimedOut = 2,
|
||||
GenericSocketError = 3,
|
||||
SocketNotConnected = 4,
|
||||
ConnectionRefused = 5,
|
||||
}
|
||||
|
||||
interface SocketTcpEvent {
|
||||
addListener(cb: (...args: any[]) => void): void;
|
||||
|
||||
removeListener(cb: (...args: any[]) => void): void;
|
||||
|
||||
fire(): void;
|
||||
|
||||
hasListener(): boolean;
|
||||
|
||||
hasListeners(): boolean;
|
||||
|
||||
// Stub
|
||||
addRules(): void;
|
||||
|
||||
// Stub
|
||||
getRules(): void;
|
||||
|
||||
// Stub
|
||||
removeRules(): void;
|
||||
}
|
||||
266
src/@awesome-cordova-plugins/plugins/sockets-udp/index.ts
Normal file
266
src/@awesome-cordova-plugins/plugins/sockets-udp/index.ts
Normal file
@@ -0,0 +1,266 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin, CordovaProperty } from '@awesome-cordova-plugins/core';
|
||||
import { Observable, fromEventPattern } from 'rxjs';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
|
||||
/**
|
||||
* @name SocketsUdp
|
||||
* @description
|
||||
* This plugin provides UDP sockets for Android and iOS.
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SocketsUdp } from '@awesome-cordova-plugins/sockets-udp/ngx';
|
||||
*
|
||||
* constructor(private socketsUdp: SocketsUdp) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* this.platform.ready().then(() => {
|
||||
* this.socketsUdp.getSockets()
|
||||
* .then((result: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
* })
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'SocketsUdp',
|
||||
plugin: 'cordova-plugin-chrome-apps-sockets-udp',
|
||||
pluginRef: 'chrome.sockets.udp',
|
||||
repo: 'https://github.com/herdwatch-apps/cordova-plugin-chrome-apps-sockets-udp',
|
||||
platforms: ['Android', 'iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
export class SocketsUdp extends AwesomeCordovaNativePlugin {
|
||||
@CordovaProperty()
|
||||
onReceive: SocketUdpEvent;
|
||||
|
||||
@CordovaProperty()
|
||||
onReceiveError: SocketUdpEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param properties
|
||||
*/
|
||||
@Cordova()
|
||||
create(properties: { persistent?: number; name?: string; bufferSize?: number }): Promise<number> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param properties
|
||||
*/
|
||||
@Cordova()
|
||||
update(socketId: number, properties: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param paused
|
||||
*/
|
||||
@Cordova()
|
||||
setPaused(socketId: number, paused: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param address
|
||||
* @param port
|
||||
*/
|
||||
@Cordova()
|
||||
bind(socketId: number, address: string, port: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param data
|
||||
* @param address
|
||||
* @param port
|
||||
*/
|
||||
@Cordova()
|
||||
send(socketId: number, data: ArrayBuffer, address: string, port: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
close(socketId: number): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
getInfo(socketId: number): Promise<SocketUdpInfo> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Cordova()
|
||||
getSockets(): Promise<SocketUdpInfo[]> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param enabled
|
||||
*/
|
||||
@Cordova()
|
||||
setBroadcast(socketId: number, enabled: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param address
|
||||
*/
|
||||
@Cordova()
|
||||
joinGroup(socketId: number, address: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param address
|
||||
*/
|
||||
@Cordova()
|
||||
leaveGroup(socketId: number, address: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param ttl
|
||||
*/
|
||||
@Cordova()
|
||||
setMulticastTimeToLive(socketId: number, ttl: any): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
* @param enabled
|
||||
*/
|
||||
@Cordova()
|
||||
setMulticastLoopbackMode(socketId: number, enabled: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param socketId
|
||||
*/
|
||||
@Cordova()
|
||||
getJoinedGroups(socketId: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch all incoming data event
|
||||
*/
|
||||
public onReceiveData(): Observable<SocketUdpDataInfo> {
|
||||
return fromEventPattern(
|
||||
(eventHandler) => this.onReceive.addListener(eventHandler),
|
||||
(errorEventHandler) => this.onReceive.removeListener(errorEventHandler)
|
||||
).pipe(
|
||||
map((socketUdpDataInfo: SocketUdpDataInfo) => {
|
||||
socketUdpDataInfo.dataAsString = socketUdpDataInfo.data
|
||||
? new TextDecoder().decode(socketUdpDataInfo.data).trim()
|
||||
: null;
|
||||
return socketUdpDataInfo;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch socket incoming data
|
||||
* @param socketId
|
||||
*/
|
||||
public onReceiveDataBySocketId(socketId: number): Observable<SocketUdpDataInfo> {
|
||||
return this.onReceiveData().pipe(filter((socketDataInfo) => socketDataInfo.socketId === socketId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch all sockets incoming error event listener
|
||||
*/
|
||||
public onReceiveDataError(): Observable<SocketUdpErrorInfo> {
|
||||
return fromEventPattern(
|
||||
(eventHandler) => this.onReceiveError.addListener(eventHandler),
|
||||
(errorEventHandler) => this.onReceiveError.removeListener(errorEventHandler)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch socket incoming error event listener
|
||||
* @param socketId
|
||||
*/
|
||||
public onReceiveDataErrorBySocketId(socketId: number): Observable<SocketUdpErrorInfo> {
|
||||
return this.onReceiveDataError().pipe(filter((socketUdpErrorInfo) => socketUdpErrorInfo.socketId === socketId));
|
||||
}
|
||||
}
|
||||
|
||||
export interface SocketUdpInfo {
|
||||
socketId: number;
|
||||
persistent?: boolean;
|
||||
bufferSize?: number;
|
||||
name?: string;
|
||||
paused?: boolean;
|
||||
localAddress?: string;
|
||||
localPort?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface SocketUdpDataInfo {
|
||||
socketId: number;
|
||||
data: ArrayBuffer;
|
||||
dataAsString: string;
|
||||
remoteAddress: string;
|
||||
remotePort: number;
|
||||
}
|
||||
|
||||
export interface SocketUdpErrorInfo {
|
||||
message: string;
|
||||
resultCode: number;
|
||||
socketId: number;
|
||||
}
|
||||
|
||||
interface SocketUdpEvent {
|
||||
addListener(cb: (...args: any[]) => void): void;
|
||||
|
||||
removeListener(cb: (...args: any[]) => void): void;
|
||||
|
||||
fire(): void;
|
||||
|
||||
hasListener(): boolean;
|
||||
|
||||
hasListeners(): boolean;
|
||||
|
||||
// Stub
|
||||
addRules(): void;
|
||||
|
||||
// Stub
|
||||
getRules(): void;
|
||||
|
||||
// Stub
|
||||
removeRules(): void;
|
||||
}
|
||||
@@ -66,22 +66,6 @@ export class StatusBar extends AwesomeCordovaNativePlugin {
|
||||
})
|
||||
styleLightContent() {}
|
||||
|
||||
/**
|
||||
* Use the blackTranslucent statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
styleBlackTranslucent() {}
|
||||
|
||||
/**
|
||||
* Use the blackOpaque statusbar (light text, for dark backgrounds).
|
||||
*/
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
styleBlackOpaque() {}
|
||||
|
||||
/**
|
||||
* Set the status bar to a specific named color. Valid options:
|
||||
* black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, CordovaFunctionOverride, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
|
||||
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
export interface ThreeDeeTouchQuickAction {
|
||||
/**
|
||||
* Type that can be used in the onHomeIconPressed callback
|
||||
* Type that can be used in the registerQuickActionListener callback
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
@@ -105,7 +105,7 @@ export interface ThreeDeeTouchForceTouch {
|
||||
*
|
||||
* this.threeDeeTouch.configureQuickActions(actions);
|
||||
*
|
||||
* this.threeDeeTouch.onHomeIconPressed().subscribe(
|
||||
* this.threeDeeTouch.registerQuickActionListener().subscribe(
|
||||
* (payload) => {
|
||||
* // returns an object that is the button you presed
|
||||
* console.log('Pressed the ${payload.title} button')
|
||||
@@ -120,9 +120,9 @@ export interface ThreeDeeTouchForceTouch {
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'ThreeDeeTouch',
|
||||
plugin: 'cordova-plugin-3dtouch',
|
||||
plugin: '@herdwatch/cordova-plugin-3dtouch',
|
||||
pluginRef: 'ThreeDeeTouch',
|
||||
repo: 'https://github.com/EddyVerbruggen/cordova-plugin-3dtouch',
|
||||
repo: 'https://github.com/herdwatch-apps/cordova-plugin-3dtouch',
|
||||
platforms: ['iOS'],
|
||||
})
|
||||
@Injectable()
|
||||
@@ -169,8 +169,10 @@ export class ThreeDeeTouch extends AwesomeCordovaNativePlugin {
|
||||
*
|
||||
* @returns {Observable<any>} returns an observable that notifies you when he user presses on the home screen icon
|
||||
*/
|
||||
@CordovaFunctionOverride()
|
||||
onHomeIconPressed(): Observable<any> {
|
||||
@Cordova({
|
||||
observable: true,
|
||||
})
|
||||
registerQuickActionListener(): Observable<ThreeDeeTouchQuickAction> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
160
src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts
Normal file
160
src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts
Normal 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[];
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user