Compare commits

..

1 Commits

Author SHA1 Message Date
Ibby Hadeed
731372b6e2 refactor: remove app-update plugin
BREAKING CHANGE: app-update plugin is removed for violating Google Play Store policies
2020-08-14 10:16:44 -04:00
17 changed files with 1768 additions and 2023 deletions

View File

@@ -1,26 +1,3 @@
# [5.28.0](https://github.com/ionic-team/ionic-native/compare/v5.27.0...v5.28.0) (2020-08-14)
### Bug Fixes
* **ble:** add missing method "isLocationEnabled" ([#3495](https://github.com/ionic-team/ionic-native/issues/3495)) ([b4462d5](https://github.com/ionic-team/ionic-native/commit/b4462d5e6c12f144412001cade1020b5f88b4ae5))
* **geolocation:** [#3303](https://github.com/ionic-team/ionic-native/issues/3303) geolocation watchPosition return type ([#3470](https://github.com/ionic-team/ionic-native/issues/3470)) ([579170a](https://github.com/ionic-team/ionic-native/commit/579170a99ea8a53634631b76ffa19b6b635c1d03))
* **hyper-track:** update to the modern sdk ([#3508](https://github.com/ionic-team/ionic-native/issues/3508)) ([44f86f3](https://github.com/ionic-team/ionic-native/commit/44f86f3ce5f6912f1cc0b4596e43066571c96b44))
* **ibeacon:** undefined locationManager ([#3505](https://github.com/ionic-team/ionic-native/issues/3505)) ([1ffad79](https://github.com/ionic-team/ionic-native/commit/1ffad79320f83038d1fc09e9112c40c86d948416))
* **metrix:** change firebase api ([#3473](https://github.com/ionic-team/ionic-native/issues/3473)) ([b0ffb0e](https://github.com/ionic-team/ionic-native/commit/b0ffb0ec4a035097c8a413f31b2382dae1eda4c7))
### Features
* **clover-go:** add support to pass signature and void payment ([#3485](https://github.com/ionic-team/ionic-native/issues/3485)) ([26d10ef](https://github.com/ionic-team/ionic-native/commit/26d10ef63346782e6d8ed37ca89bd2dd7402aa0a))
* **diagnostics:** Add support for new iOS14-LocationAccuracy Permission ([#3490](https://github.com/ionic-team/ionic-native/issues/3490)) ([ccca644](https://github.com/ionic-team/ionic-native/commit/ccca644134999365a729b4a7d554da6a011eb693))
* **nfc:** update to phonegap-nfc@1.2.0 ([#3486](https://github.com/ionic-team/ionic-native/issues/3486)) ([d7ccd45](https://github.com/ionic-team/ionic-native/commit/d7ccd454fb757d8d3be57a70bfa7fb3c269e3318))
* **onesignal:** add in-app messages methods ([#3481](https://github.com/ionic-team/ionic-native/issues/3481)) ([eec3fec](https://github.com/ionic-team/ionic-native/commit/eec3fec7ff820e96443e6e3f0d7bf96dac359038))
* **purchases:** update to plugin version 1.2.0 ([#3482](https://github.com/ionic-team/ionic-native/issues/3482)) ([a010bb1](https://github.com/ionic-team/ionic-native/commit/a010bb186964b8b825ab80f9cf6092794ee2e4b1))
* **smartlook:** update to 1.5.2 ([#3498](https://github.com/ionic-team/ionic-native/issues/3498)) ([5aa5757](https://github.com/ionic-team/ionic-native/commit/5aa57577956c13e8fe34d2c658690df7daf86ef4))
# [5.27.0](https://github.com/ionic-team/ionic-native/compare/v5.26.0...v5.27.0) (2020-06-23)

2855
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "5.28.0",
"version": "5.27.0",
"description": "Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support",
"homepage": "https://ionicframework.com/",
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -23,20 +23,20 @@
"prettier": "prettier --write \"**/*.{js,json,css,scss,less,md,ts,html,component.html}\""
},
"devDependencies": {
"@angular/common": "^9.1.12",
"@angular/compiler": "^9.1.12",
"@angular/compiler-cli": "^9.1.12",
"@angular/core": "^9.1.12",
"@angular/common": "^9.1.11",
"@angular/compiler": "^9.1.11",
"@angular/compiler-cli": "^9.1.11",
"@angular/core": "^9.1.11",
"@types/cordova": "0.0.34",
"@types/fs-extra": "^9.0.1",
"@types/jest": "^26.0.9",
"@types/lodash": "^4.14.159",
"@types/node": "^12.12.54",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.156",
"@types/node": "^12.12.47",
"@types/rimraf": "^3.0.0",
"@types/webpack": "^4.41.21",
"ajv": "^6.12.3",
"@types/webpack": "^4.41.17",
"ajv": "^6.12.2",
"async-promise-queue": "^1.0.5",
"conventional-changelog-cli": "^2.1.0",
"conventional-changelog-cli": "^2.0.34",
"cz-conventional-changelog": "^3.2.0",
"dgeni": "^0.4.12",
"dgeni-packages": "0.16.10",
@@ -46,26 +46,26 @@
"gulp-replace": "^1.0.0",
"gulp-tslint": "^8.1.4",
"husky": "^4.2.5",
"jest": "^26.4.0",
"jest": "^26.1.0",
"lint-staged": "^10.2.11",
"lodash": "^4.17.20",
"lodash": "^4.17.15",
"minimist": "^1.2.5",
"natives": "^1.1.6",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"rxjs": "^6.6.2",
"ts-jest": "^26.2.0",
"rxjs": "^6.5.5",
"ts-jest": "^26.1.1",
"ts-node": "^8.10.2",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-ionic-rules": "0.0.21",
"typedoc": "^0.18.0",
"typedoc": "^0.17.7",
"typescript": "~3.8.3",
"typescript-tslint-plugin": "0.5.5",
"uglifyjs-webpack-plugin": "^2.2.0",
"unminified-webpack-plugin": "^2.0.0",
"webpack": "^4.44.1",
"winston": "^3.3.3",
"webpack": "^4.43.0",
"winston": "^3.3.2",
"zone.js": "^0.10.3"
},
"jest": {

View File

@@ -1,66 +0,0 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AppUpdateOptions {
authType?: string;
username?: string;
password?: string;
skipPromptDialog?: boolean;
skipProgressDialog?: boolean;
}
/**
* @name App Update
* @description
* This plugin does self-update for android
*
* @usage
*
* You should first host an XML file on your server with the following data in it:
* ```xml
* <update>
* <version>302048</version>
* <name>APK Name</name>
* <url>https://your-remote-api.com/YourApp.apk</url>
* </update>
* ```
*
* Then use the following code:
*
* ```typescript
* import { AppUpdate } from '@ionic-native/app-update/ngx';
*
* constructor(private appUpdate: AppUpdate) {
*
* const updateUrl = 'https://your-remote-api.com/update.xml';
* this.appUpdate.checkAppUpdate(updateUrl).then(() => { console.log('Update available') });
*
* }
* ```
*
* The plugin will compare the app version and update it automatically if the API has a newer version to install.
* @interfaces
* AppUpdateOptions
*/
@Plugin({
pluginName: 'AppUpdate',
plugin: 'cordova-plugin-app-update',
pluginRef: 'AppUpdate',
repo: 'https://github.com/vaenow/cordova-plugin-app-update',
platforms: ['Android'],
})
@Injectable()
export class AppUpdate extends IonicNativePlugin {
/**
* Check and update
* @param {string} updateUrl update api url
* @param {AppUpdateOptions} [options] options
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova({
callbackOrder: 'reverse',
})
checkAppUpdate(updateUrl: string, options?: AppUpdateOptions): Promise<any> {
return;
}
}

View File

@@ -9,8 +9,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
*
* Requires Cordova plugin: cordova-plugin-badge. For more info, please see the [Badge plugin docs](https://github.com/katzer/cordova-plugin-badge).
*
* Android Note: Badges have historically only been a feature implemented by third party launchers and not visible unless one of those launchers was being used (E.G. Samsung or Nova Launcher) and if enabled by the user. As of Android 8 (Oreo), [notification badges](https://developer.android.com/training/notify-user/badges) were introduced officially to reflect unread notifications. This plugin is unlikely to work as expected on devices running Android 8 or newer. Please see the [local notifications plugin docs](https://github.com/katzer/cordova-plugin-local-notifications) for more information on badge use with notifications.
*
* @usage
* ```typescript
* import { Badge } from '@ionic-native/badge/ngx';

View File

@@ -455,12 +455,9 @@ export class BLE extends IonicNativePlugin {
* @param {string} serviceUUID UUID of the BLE service
* @param {string} characteristicUUID UUID of the BLE characteristic
* @return {Observable<any>} Returns an Observable that notifies of characteristic changes.
* The observer emit an array with data at index 0 and sequence order at index 1.
* The sequence order is always undefined on iOS. On android it leave the client to check the sequence order and reorder if needed
*/
@Cordova({
observable: true,
destruct: true,
clearFunction: 'stopNotification',
clearWithArgs: true,
})
@@ -607,15 +604,4 @@ export class BLE extends IonicNativePlugin {
bondedDevices(): Promise<any[]> {
return;
}
/**
* Reports if location services are enabled.
* Android only
*
* @returns {Promise<void>}
*/
@Cordova()
isLocationEnabled(): Promise<void> {
return;
}
}

View File

@@ -24,9 +24,6 @@ export interface SaleResponse extends Response {
cardFirst6?: string;
cardLast4?: string;
}
export interface VoidPaymentResponse extends Response {
paymentId?: string;
}
/**
* @name Clover Go
@@ -59,14 +56,6 @@ export interface VoidPaymentResponse extends Response {
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* this.cloverGo.sign(signInfo)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* this.cloverGo.voidPayment(paymentInfo)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
@@ -75,7 +64,7 @@ export interface VoidPaymentResponse extends Response {
pluginRef: 'clovergo',
repo: 'https://github.com/hotwax/cordova-plugin-clovergo',
install: 'ionic plugin add cordova-plugin-clovergo',
platforms: ['Android'],
platforms: ['Android', 'iOS'],
})
@Injectable()
export class CloverGo extends IonicNativePlugin {
@@ -118,27 +107,4 @@ export class CloverGo extends IonicNativePlugin {
sale(saleInfo: object): Promise<SaleResponse> {
return;
}
/**
* This method is used to pass signature as two
* dimensional number array that represents points
* of signature on screen.
* The list is passed as signature in SignInfo object.
* @param signInfo {object}
* @return {Promise<SaleResponse>}
*/
@Cordova()
sign(signInfo: object): Promise<SaleResponse> {
return;
}
/**
* This function void any payment done through the device
* @param saleInfo {object}
* @return {Promise<VoidPaymentResponse>}
*/
@Cordova()
voidPayment(paymentInfo: object): Promise<VoidPaymentResponse> {
return;
}
}

View File

@@ -89,15 +89,6 @@ export class Diagnostic extends IonicNativePlugin {
WHEN_IN_USE: 'when_in_use',
};
/**
* iOS ONLY
* Location accuracy authorization
*/
locationAccuracyAuthorization: {
FULL: 'full';
REDUCED: 'reduced';
};
permissionGroups = {
CALENDAR: ['READ_CALENDAR', 'WRITE_CALENDAR'],
CAMERA: ['CAMERA'],
@@ -938,36 +929,4 @@ export class Diagnostic extends IonicNativePlugin {
getMotionAuthorizationStatus(): Promise<string> {
return;
}
/**
* Returns the location accuracy authorization for the application on iOS 14+. Note: calling on iOS <14 will result in the Promise being rejected.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#getlocationaccuracyauthorization)
*
* @return {Promise<string>}
*/
@Cordova({ platform: ['iOS'] })
getLocationAccuracyAuthorization(): Promise<string> {
return;
}
/**
* Requests temporary access to full location accuracy for the application on iOS 14+.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#requesttemporaryfullaccuracyauthorization)
*
* @return {Promise<string>}
*/
@Cordova({ platforms: ['iOS'] })
requestTemporaryFullAccuracyAuthorization(purpose: string): Promise<string> {
return;
}
/**
* Registers a function to be called when a change in location accuracy authorization occurs on iOS 14+.
*
* Learn more about this method [here](https://github.com/dpa99c/cordova-diagnostic-plugin#registerLocationAccuracyAuthorizationChangeHandler)
*/
@Cordova({ platforms: ['iOS'], sync: true })
registerLocationAccuracyAuthorizationChangeHandler(handler: Function): void {}
}

View File

@@ -7,6 +7,10 @@ export interface IDynamicLink {
deepLink: string;
}
export interface ICreatedDynamicLink {
url: string;
}
export interface ILinkOptions {
domainUriPrefix?: string;
link?: string;
@@ -112,36 +116,36 @@ export class FirebaseDynamicLinks extends IonicNativePlugin {
/**
* Creates a Dynamic Link from the parameters. Returns a promise fulfilled with the new dynamic link url.
* @param {ILinkOptions} opt [Dynamic Link Parameters](https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks#dynamic-link-parameters)
* @return {Promise<string>} Returns a promise with the url
* @return {Promise<ICreatedDynamicLink>} Returns a promise with the url
*/
@Cordova({
otherPromise: true,
})
createDynamicLink(opts: ILinkOptions): Promise<string> {
createDynamicLink(opts: ILinkOptions): Promise<ICreatedDynamicLink> {
return;
}
/**
* Creates a shortened Dynamic Link from the parameters. Shorten the path to a string that is only as long as needed to be unique, with a minimum length of 4 characters. Use this method if sensitive information would not be exposed if a short Dynamic Link URL were guessed.
* @param {ILinkOptions} opt [Dynamic Link Parameters](https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks#dynamic-link-parameters)
* @return {Promise<string>} Returns a promise with the url
* @return {Promise<ICreatedDynamicLink>} Returns a promise with the url
*/
@Cordova({
otherPromise: true,
})
createShortDynamicLink(opts: ILinkOptions): Promise<string> {
createShortDynamicLink(opts: ILinkOptions): Promise<ICreatedDynamicLink> {
return;
}
/**
* Creates a Dynamic Link from the parameters. Shorten the path to an unguessable string. Such strings are created by base62-encoding randomly generated 96-bit numbers, and consist of 17 alphanumeric characters. Use unguessable strings to prevent your Dynamic Links from being crawled, which can potentially expose sensitive information.
* @param {ILinkOptions} opt [Dynamic Link Parameters](https://github.com/chemerisuk/cordova-plugin-firebase-dynamiclinks#dynamic-link-parameters)
* @return {Promise<string>} Returns a promise with the url
* @return {Promise<ICreatedDynamicLink>} Returns a promise with the url
*/
@Cordova({
otherPromise: true,
})
createUnguessableDynamicLink(opts: ILinkOptions): Promise<string> {
createUnguessableDynamicLink(opts: ILinkOptions): Promise<ICreatedDynamicLink> {
return;
}
}

View File

@@ -192,10 +192,10 @@ export class Geolocation extends IonicNativePlugin {
* ```
*
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
* @returns {Observable<Geoposition | PositionError>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
*/
watchPosition(options?: GeolocationOptions): Observable<Geoposition | PositionError> {
return new Observable<Geoposition | PositionError>((observer: any) => {
watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
return new Observable<Geoposition>((observer: any) => {
const watchId = navigator.geolocation.watchPosition(
observer.next.bind(observer),
observer.next.bind(observer),

View File

@@ -1,234 +1,212 @@
import { Injectable } from '@angular/core';
import {
Plugin,
Cordova,
CordovaProperty,
CordovaInstance,
InstanceProperty,
IonicNativePlugin,
} from '@ionic-native/core';
import { kMaxLength } from 'buffer';
import { resolve } from 'dns';
import { reject } from 'lodash';
import { error } from 'console';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @beta
* @name HyperTrack
* @description
* HyperTrack cordova plugin wrapper for Ionic Native. Location-based services provider.
* Make sure to include your publishable key at config.xml (see [HyperTrack Cordova Setup](https://docs.hypertrack.com/sdks/cordova/setup.html#step-2-configure-the-sdk)).
*
* @usage
* ```typescript
* import { HyperTrack } from '@ionic-native/hyper-track/ngx';
*
* constructor(private hyperTrack: HyperTrack) { }
*
* // Check if app has location permissions enabled
* this.hyperTrack.checkLocationPermission().then(response => {
* // response (String) can be "true" or "false"
* if (response != "true") {
* // Ask for permissions
* this.hyperTrack.requestPermissions().then(response => {}, error => {});
* }
* }, error => {});
*
* // Check if app has location services enabled
* this.hyperTrack.checkLocationServices().then(response => {
* // response (String) can be "true" or "false"
* if (response != "true") {
* // Request services to be enabled
* this.hyperTrack.requestLocationServices().then(response => {}, error => {});
* }
* }, error => {});
*
* // First set the current user. This can be done via getOrCreateUser() or setUserId()
* this.hyperTrack.setUserId("xxx").then(user => {
* // user (String) is a String representation of a User's JSON
*
* this.hyperTrack.startTracking().then(userId => {}, trackingError => {});
*
* this.hyperTrack.createAndAssignAction('visit', 'lookupId','address', 20.12, -100.3).then(action => {
* // Handle action. It's a String representation of the Action's JSON. For example:
* // '{"eta":"Jul 17, 2017 12:50:03 PM","assigned_at":"Jul 17, 2017 12:34:38 PM",,"distance":"0.0",...}'
* }, error => {});
*
* // You can complete an action with completeAction() or completeActionWithLookupId()
* this.hyperTrack.completeAction('action-id').then(response => {
* // Handle response (String). Should be "OK".
* }, error => {});
*
* this.hyperTrack.getCurrentLocation().then(location => {
* // Handle location. It's a String representation of a Location's JSON.For example:
* // '{"mAccuracy":22.601,,"mLatitude":23.123456, "mLongitude":-100.1234567, ...}'
* }, error => {});
*
* this.hyperTrack.stopTracking().then(success => {
* // Handle success (String). Should be "OK".
* }, error => {});
*
* }, error => {});*
* ```
*/
@Plugin({
pluginName: 'cordova-plugin-hypertrack-v3',
plugin: 'cordova-plugin-hypertrack-v3',
pluginRef: 'hypertrack',
repo: 'https://github.com/hypertrack/cordova-plugin-hypertrack.git',
pluginName: 'HyperTrack',
plugin: 'cordova-plugin-hypertrack',
pluginRef: 'cordova.plugins.HyperTrack',
repo: 'https://github.com/hypertrack/hypertrack-cordova',
platforms: ['Android'],
})
@Injectable()
export class HyperTrackPlugin extends IonicNativePlugin {
export class HyperTrack extends IonicNativePlugin {
/**
* Returns given text. For testing purposes.
* @param {String} text Given text to print
* @returns {Promise<any>} Returns a Promise that resolves with the result text (which is the same as the given text) if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
initialize(publishableKey: string): Promise<HyperTrackCordova> {
helloWorld(text: String): Promise<String> {
return;
}
/**
* Create a new user to identify the current device or get a user from a lookup id.
* @param {String} name User's name
* @param {String} phone User's phone
* @param {String} photo User's photo as URL or a Base64 converted string
* @param {String} lookupId User's lookupId, which is used to check if a new user is to be created (in this case you could set it to an internal reference for the user that you can use later to identify it), or if one with an existing lookupId is to be used.
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the User's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
enableDebugLogging(): Promise<any> {
getOrCreateUser(name: String, phone: String, photo: String, lookupId: String): Promise<any> {
return;
}
/**
* Set UserId for the SDK created using HyperTrack APIs. This is useful if you already have a user previously created.
* @param {String} userId User's ID
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred. An "OK" response doesn't necessarily mean that the userId was found. It just means that it was set correctly.
*/
@Cordova()
setUserId(userId: String): Promise<any> {
return;
}
/**
* Enable the SDK and start tracking. This will fail if there is no user set.
* @returns {Promise<any>} Returns a Promise that resolves with the userId (String) of the User being tracked if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
startTracking(): Promise<any> {
return;
}
/**
* Create and assign an action to the current user using specified parameters
* @param {String} type The action type. Can be one from "pickup", "delivery", "dropoff", "visit", "stopover" or "task"
* @param {String} lookupId The Action's desired lookupId
* @param {String} expectedPlaceAddress The address of the Action
* @param {Number} expectedPlaceLatitude The latitude of the Action
* @param {Number} expectedPlaceLongitude The longitude of the Action
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Action's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
createAndAssignAction(
type: String,
lookupId: String,
expectedPlaceAddress: String,
expectedPlaceLatitude: Number,
expectedPlaceLongitude: Number
): Promise<any> {
return;
}
/**
* Complete an action from the SDK by its ID
* @param {String} actionId ID of the Action that will be marked as completed
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeAction(actionId: String): Promise<any> {
return;
}
/**
* Complete an action from the SDK using Action's lookupId as parameter
* @param {String} lookupId Lookup ID of the Action that will be marked as completed
* @returns {Promise<any>} Returns a Promise that resolves with an "OK" string if successful, or it gets rejected if an error ocurred.
*/
@Cordova()
completeActionWithLookupId(lookupId: String): Promise<any> {
return;
}
/**
* Disable the SDK and stop tracking.
* Needs user setting (via getOrCreateUser() or setUserId()) first.
* @returns {Promise<any>} Returns a Promise that resolves with the an "OK" string if successful, or it gets rejected if an error ocurred. One example of an error is not setting a User with getOrCreateUser() or setUserId() before calling this function.
*/
@Cordova()
stopTracking(): Promise<any> {
return;
}
/**
* Get user's current location from the SDK
* @returns {Promise<any>} Returns a Promise that resolves with a string representation of the Location's JSON, or it gets rejected if an error ocurred.
*/
@Cordova()
getCurrentLocation(): Promise<any> {
return;
}
/**
* Check if Location permission has been granted to the app (for Android).
* Returns "true" or "false" in success method accordingly.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location permission was granted, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationPermission(): Promise<any> {
return;
}
/**
* Request user to grant Location access to the app (for Anrdoid).
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location access was given to the app, or it gets rejected if an error ocurred.
*/
@Cordova()
requestPermissions(): Promise<any> {
return;
}
/**
* Check if Location services are enabled on the device (for Android).
* Returns "true" or "false" in success method accordingly.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if location services are enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
checkLocationServices(): Promise<any> {
return;
}
/**
* Request user to enable Location services on the device.
* For Android Marshmallow and above. In other platforms, the Promise is never resolved.
* @returns {Promise<any>} Returns a Promise that resolves with the a string that can be "true" or "false", depending if Location services were enabled, or it gets rejected if an error ocurred.
*/
@Cordova()
requestLocationServices(): Promise<any> {
return;
}
}
// Interfaces for Cordova Plugin callbacks
interface DeviceIdReceiver {
(deviceId: string): any;
}
interface TrackingStateReceiver {
(isRunning: boolean): any;
}
interface FailureHandler {
(error: Error): any;
}
interface SuccessHandler {
(): any;
}
// SDK instance that exposed from Cordova utilizes usage of callbacks, so we
// wrap it with adapter to avoid mix of callbacks and Promises
interface HyperTrackCordova {
getDeviceId(success: DeviceIdReceiver, error: FailureHandler): void;
isRunning(success: TrackingStateReceiver, error: FailureHandler): void;
setDeviceName(name: string, success: SuccessHandler, error: FailureHandler): void;
setDeviceMetadata(metadata: Object, success: SuccessHandler, error: FailureHandler): void;
setTrackingNotificationProperties(
title: string,
message: string,
success: SuccessHandler,
error: FailureHandler
): void;
addGeoTag(geotagData: Object, expectedLocation: Coordinates, success: SuccessHandler, error: FailureHandler): void;
requestPermissionsIfNecessary(success: SuccessHandler, error: FailureHandler): void;
allowMockLocations(success: SuccessHandler, error: FailureHandler): void;
syncDeviceSettings(success: SuccessHandler, error: FailureHandler): void;
}
export class CoordinatesValidationError extends Error {}
/** Wrapper class for passing spatial geoposition as a geotag's expected location */
export class Coordinates {
constructor(latitude: number, longitude: number) {
if (latitude < -90.0 || latitude > 90.0 || longitude < -180.0 || longitude > 180.0) {
throw new CoordinatesValidationError('latitude and longitude should be of correct valaues');
}
}
}
/**
* @usage
* ```typescript
* import { HyperTrack } from '@ionic-native/hyper-track';
*
* initializeHypertrack() {
* HyperTrack.enableDebugLogging();
* HyperTrack.initialize('YOUR_PUBLISHING_KEY')
* .then( this.onSdkInstanceReceived )
* .catch( (err) => console.error("HyperTrack init failed with error " + err) );
* }
* onSdkInstanceReceived(sdkInstance: HyperTrack) {
* sdkInstance.getDeviceId()
* .then((id) => console.log("Got device id " + id))
* .then(() => sdkInstance.setDeviceName("Elvis Ionic"))
* .then(() => console.log("Device name was changed"))
* .then(() => sdkInstance.setDeviceMetadata({platform: "Ionic Android"}))
* .then(() => console.log("Device metadata was changed"))
* .then(() => sdkInstance.setTrackingNotificationProperties("Tracking On", "Ionic SDK is tracking"))
* .then(() => console.log("Notification properties were changed"))
* .catch((err) => console.error("Got error in HyperTrack " + err));
* }
*
* ```
*
*/
export class HyperTrack {
/** Enables debug log in native HyperTrack SDK. */
static enableDebugLogging(): void {
new HyperTrackPlugin().enableDebugLogging();
}
/**
* Entry point into SDK.
*
* Initializes SDK. Also resolves SDK instance that could be used to query deviceId or set
* various data.
* @param publishableKey account-specific secret from the HyperTrack dashborad.
*
* @see {@link https://dashboard.hypertrack.com/setup}.
*/
static initialize(publishableKey: string): Promise<HyperTrack> {
return new Promise((resolve, reject) => {
new HyperTrackPlugin()
.initialize(publishableKey)
.then((cordovaInstance: HyperTrackCordova) => {
resolve(new HyperTrack(cordovaInstance));
})
.catch((err: Error) => reject(err));
});
}
/** Resolves device ID that could be used to identify the device. */
getDeviceId(): Promise<string> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.getDeviceId(
deviceId => resolve(deviceId),
err => reject(err)
);
});
}
/** Resolves to true if tracking service is running and false otherwise */
isRunning(): Promise<boolean> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.isRunning(
isRunning => resolve(isRunning),
err => reject(err)
);
});
}
/** Sets device name that could be used to identify the device in HyperTrack dashboard */
setDeviceName(name: string): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.setDeviceName(
name,
() => resolve(),
err => reject(err)
);
});
}
/**
* Use this to set additional properties, like segments, teams etc.
* @param metadata key-value pais of properties.
*/
setDeviceMetadata(metadata: Object): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.setDeviceMetadata(
metadata,
() => resolve(),
err => reject(err)
);
});
}
/** Updates title and text in persistent notification, that appears when tracking is active. */
setTrackingNotificationProperties(title: string, message: string): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.setTrackingNotificationProperties(
title,
message,
() => resolve(),
err => reject(err)
);
});
}
/** Adds special marker-like object to device timeline. */
addGeotag(geotagData: Object, expectedLocation?: Coordinates): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.addGeoTag(
geotagData,
expectedLocation,
() => resolve(),
err => reject(err)
);
});
}
/** Pops up permission request dialog, if permissions weren't granted before or does nothing otherwise. */
requestPermissionsIfNecessary(): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.requestPermissionsIfNecessary(
() => resolve(),
err => reject(err)
);
});
}
/** Allows injecting false locations into the SDK, which ignores them by default. */
allowMockLocations(): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.allowMockLocations(
() => resolve(),
err => reject(err)
);
});
}
/**
* Synchronizes tracking state with platform model. This method is used to
* harden platform2device communication channel.
*/
syncDeviceSettings(): Promise<any> {
return new Promise((resolve, reject) => {
this.cordovaInstanceHandle.syncDeviceSettings(
() => resolve(),
err => reject(err)
);
});
}
private constructor(private cordovaInstanceHandle: HyperTrackCordova) {}
}

View File

@@ -293,7 +293,7 @@ export class IBeacon extends IonicNativePlugin {
*/
@CordovaCheck({ sync: true })
Delegate(): IBeaconDelegate {
const delegate = new window.cordova.plugins.locationManager.Delegate();
const delegate = new cordova.plugins.locationManager.Delegate();
delegate.didChangeAuthorizationStatus = (pluginResult?: IBeaconPluginResult) => {
return new Observable<IBeaconPluginResult>((observer: any) => {
@@ -358,7 +358,7 @@ export class IBeacon extends IonicNativePlugin {
});
};
window.cordova.plugins.locationManager.setDelegate(delegate);
cordova.plugins.locationManager.setDelegate(delegate);
return delegate;
}
@@ -382,7 +382,7 @@ export class IBeacon extends IonicNativePlugin {
minor?: number,
notifyEntryStateOnDisplay?: boolean
): BeaconRegion {
return new window.cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
return new cordova.plugins.locationManager.BeaconRegion(identifer, uuid, major, minor, notifyEntryStateOnDisplay);
}
/**

View File

@@ -11,8 +11,6 @@ export class MetrixConfig {
private defaultTrackerToken: string = null;
private shouldLaunchDeeplink = false;
private firebaseAppId: string = null;
private firebaseProjectId: string = null;
private firebaseApiKey: string = null;
private isLocationListeningEnable = false;
private eventUploadThreshold: number = null;
private eventUploadMaxBatchSize: number = null;
@@ -34,10 +32,8 @@ export class MetrixConfig {
this.defaultTrackerToken = defaultTrackerToken;
}
setFirebaseId(firebaseAppId: string, firebaseProjectId: string, firebaseApiKey: string) {
setFirebaseAppId(firebaseAppId: string) {
this.firebaseAppId = firebaseAppId;
this.firebaseProjectId = firebaseProjectId;
this.firebaseApiKey = firebaseApiKey;
}
setAppSecret(secretId: number, info1: number, info2: number, info3: number, info4: number) {

View File

@@ -38,14 +38,6 @@ export interface NfcTag {
type?: string;
}
export interface ScanOptions {
/**
* If true, keep the scan session open so write can be called
* after reading. The default value is false.
*/
keepSessionOpen?: boolean;
}
/**
* @name NFC
* @description
@@ -93,7 +85,7 @@ export interface ScanOptions {
plugin: 'phonegap-nfc',
pluginRef: 'nfc',
repo: 'https://github.com/chariotsolutions/phonegap-nfc',
platforms: ['Android', 'iOS', 'Windows'],
platforms: ['Android', 'BlackBerry 10', 'Windows', 'Windows Phone 8', 'iOS'],
})
/**
* @{ NFC } class methods
@@ -138,7 +130,7 @@ export class NFC extends IonicNativePlugin {
* https://github.com/chariotsolutions/phonegap-nfc#nfcscanndef
*/
@Cordova({ sync: true })
scanNdef(options?: ScanOptions): Promise<NfcTag> {
scanNdef(): Promise<NfcTag> {
return;
}
@@ -149,7 +141,7 @@ export class NFC extends IonicNativePlugin {
* https://github.com/chariotsolutions/phonegap-nfc#nfcscantag
*/
@Cordova({ sync: true })
scanTag(options?: ScanOptions): Promise<NfcTag> {
scanTag(): Promise<NfcTag> {
return;
}

View File

@@ -303,28 +303,6 @@ export enum OSActionType {
ActionTake = 1,
}
/**
* Details about the In-App Message action element (button or image) that was tapped on.
*/
export interface OSInAppMessageAction {
/**
* An optional click name defined for the action element. null or nil (iOS) if not set.
*/
click_name: string;
/**
* An optional URL that opens when the action takes place. null or nil (iOS) if not set.
*/
click_url: string;
/**
* `true` if this is the first time the user has pressed any action on the In-App Message.
*/
first_click: boolean;
/**
* If `true`, the In-App Message will animate off the screen. If `false`, the In-App Message will stay on screen until the user dismisses it.
*/
closes_message: boolean;
}
/**
* @name OneSignal
* @description
@@ -428,7 +406,6 @@ export interface OSInAppMessageAction {
* OSBackgroundImageLayout
* OSNotificationOpenedResult
* OSActionType
* OSInAppMessageAction
*/
@Plugin({
pluginName: 'OneSignal',
@@ -487,18 +464,6 @@ export class OneSignal extends IonicNativePlugin {
return;
}
/**
* Use to process an In-App Message the user just tapped on.
*
* @return {Observable<OSInAppMessageAction>}
*/
@Cordova({
observable: true,
})
handleInAppMessageClicked(): Observable<OSInAppMessageAction> {
return;
}
/**
* **iOS** - Settings for iOS apps
*
@@ -816,67 +781,4 @@ export class OneSignal extends IonicNativePlugin {
*/
@Cordova()
removeExternalUserId(): void {}
/**
* Add a trigger. May show an In-App Message if its trigger conditions were met.
*
* @param {string} key Key for the trigger.
* @param {string | number | Object} value Value for the trigger. String or number recommended. Object passed in will be converted to a string.
*/
@Cordova({
sync: true,
})
addTrigger(key: string, value: string | number | Object): void {}
/**
* Add a map of triggers. May show an In-App Message if its trigger conditions were met.
*
* @param {Object.<string, string | number | Object>} triggers Allows you to set multiple trigger key/value pairs simultaneously. Pass a json object with key/value pairs like: `{"key": "value", "key2": "value2"}`.
*/
@Cordova({
sync: true,
})
addTriggers(triggers: Object): void {}
/**
* Removes a single trigger for the given key. May show an In-App Message if its trigger conditions were met.
*
* @param {string} key Key for trigger to remove.
*/
@Cordova({
sync: true,
})
removeTriggerForKey(key: string): void {}
/**
* Removes a list of triggers based on a collection (array) of keys. May show an In-App Message if its trigger conditions were met.
*
* @param {string[]} keys Removes a collection of triggers from their keys. Pass an array of trigger keys like: `["key1", "key2", "key3"]`.
*/
@Cordova({
sync: true,
})
removeTriggersForKeys(keys: string[]): void {}
/**
* Gets a trigger value for a provided trigger key.
*
* @param {string} key Key for trigger to get value.
* @returns {Promise<string | number | Object>} Return value set with `addTrigger`, or `null`/`nil` (iOS) if never set or removed.
*/
@Cordova()
getTriggerValueForKey(key: string): Promise<string | number | Object> {
return;
}
/**
* Allows you to temporarily pause all In-App Messages. You may want to do this while the user is engaged in an activity that you don't want a message to interrupt (such as watching a video).
* An In-App Message that would display if not paused will display right after resume if its conditions to display remains satisfied.
*
* @param {boolean} pause To pause, set `true`. To resume, set `false`.
*/
@Cordova({
sync: true,
})
pauseInAppMessages(pause: boolean): void {}
}

View File

@@ -207,7 +207,7 @@ export enum INTRO_ELIGIBILITY_STATUS {
*/
@Plugin({
pluginName: 'Purchases',
plugin: 'cordova-plugin-purchases@1.2.0',
plugin: 'cordova-plugin-purchases@1.1.0',
pluginRef: 'Purchases', // the variable reference to call the plugin, example: navigator.geolocation
repo: 'https://github.com/RevenueCat/cordova-plugin-purchases', // the github repository URL for the plugin
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
@@ -259,12 +259,9 @@ export class Purchases extends IonicNativePlugin {
* @param {boolean} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and
* want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have
* to acknowledge the purchases yourself.
* @param {string?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
* Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults
* suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
*/
@Cordova({ sync: true })
setup(apiKey: string, appUserID?: string | null, observerMode = false, userDefaultsSuiteName?: string): void {}
setup(apiKey: string, appUserID?: string | null, observerMode = false): void {}
/**
* Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
@@ -542,13 +539,8 @@ export class Purchases extends IonicNativePlugin {
/**
* Invalidates the cache for purchaser information.
*
* Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
* Refer to https://docs.revenuecat.com/docs/purchaserinfo#section-get-user-information for more information on
* using the cache properly.
*
* This is useful for cases where purchaser information might have been updated outside of the
* app, like if a promotional subscription is granted through the RevenueCat dashboard.
* This is useful for cases where purchaser information might have been updated outside of the app, like if a
* promotional subscription is granted through the RevenueCat dashboard.
*/
@Cordova({ sync: true })
invalidatePurchaserInfoCache(): void {}
@@ -597,13 +589,6 @@ export class Purchases extends IonicNativePlugin {
@Cordova({ sync: true })
setPushToken(pushToken: string | null): void {}
/**
* Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact.
* @param url Proxy URL as a string.
*/
@Cordova({ sync: true })
setProxyURL(url: string): void {}
}
/**
@@ -742,18 +727,6 @@ export interface PurchaserInfo {
* in Android
*/
readonly originalApplicationVersion: string | null;
/**
* Returns the purchase date for the version of the application when the user bought the app.
* Use this for grandfathering users when migrating to subscriptions.
*/
readonly originalPurchaseDate: string | null;
/**
* URL to manage the active subscription of the user. If this user has an active iOS
* subscription, this will point to the App Store, if the user has an active Play Store subscription
* it will point there. If there are no active subscriptions it will be null.
* If there are multiple for different platforms, it will point to the device store.
*/
readonly managementURL: string | null;
}
export interface PurchasesProduct {

View File

@@ -1,55 +1,13 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export class SmartlookSetupConfigBuilder {
private readonly _smartlookSetupConfig: SmartlookSetupConfig;
constructor(smartlookAPIKey: string) {
this._smartlookSetupConfig = new SmartlookSetupConfig(smartlookAPIKey);
}
fps(fps: number): SmartlookSetupConfigBuilder {
this._smartlookSetupConfig.fps = fps;
return this;
}
renderingMode(renderingMode: string): SmartlookSetupConfigBuilder {
this._smartlookSetupConfig.renderingMode = renderingMode;
return this;
}
startNewSession(startNewSession: boolean): SmartlookSetupConfigBuilder {
this._smartlookSetupConfig.startNewSession = startNewSession;
return this;
}
startNewSessionAndUser(startNewSessionAndUser: boolean): SmartlookSetupConfigBuilder {
this._smartlookSetupConfig.startNewSessionAndUser = startNewSessionAndUser;
return this;
}
build(): SmartlookSetupConfig {
return this._smartlookSetupConfig;
}
}
export class SmartlookSetupConfig {
private smartlookAPIKey: string;
fps: number;
renderingMode: string;
startNewSession: boolean;
startNewSessionAndUser: boolean;
private fps: number;
constructor(smartlookAPIKey: string) {
constructor(smartlookAPIKey: string, fps?: number) {
this.smartlookAPIKey = smartlookAPIKey;
}
}
export class SmartlookResetSession {
private resetUser: string;
constructor(resetUser: string) {
this.resetUser = resetUser;
this.fps = fps;
}
}
@@ -180,19 +138,6 @@ export class SmartlookReferrer {
}
}
export class SmartlookDashboardSessionUrl {
private withCurrentTimestamp: boolean;
constructor(withCurrentTimestamp: boolean) {
this.withCurrentTimestamp = withCurrentTimestamp;
}
}
export interface SmartlookIntegrationListener {
onSessionReady: (dashboardSessionUrl: string) => any;
onVisitorReady: (dashboardVisitorUrl: string) => any;
}
export class SmartlookRenderingMode {
private renderingMode: string;
@@ -231,9 +176,7 @@ export class SmartlookRenderingMode {
* }
* ```
* @classes
* SmartlookSetupConfigBuilder
* SmartlookSetupConfig
* SmartlookResetSession
* SmartlookUserIdentifier
* SmartlookEventTrackingMode
* SmartlookNavigationEvent
@@ -246,7 +189,6 @@ export class SmartlookRenderingMode {
* SmartlookGlobalEventProperty
* SmartlookGlobalEventPropertyKey
* SmartlookReferrer
* SmartlookDashboardSessionUrl
* SmartlookRenderingMode
*/
@Plugin({
@@ -263,9 +205,6 @@ export class Smartlook extends IonicNativePlugin {
* @param config SmartlookSetupConfig object.
* @param config.smartlookAPIKey (required) Smartlook API key (you can obtain it in your dashboard).
* @param config.fps (optional) recorded video framerate (allowed values 2-10 fps).
* @param options.renderingMode (optional) Mode defining the video output of recording.
* @param options.startNewSession (optional) If true new session is going to be created
* @param options.startNewSessionAndUser (optional) If true new session and visitor is going to be created
*/
@Cordova({ sync: true })
setupAndStartRecording(config: SmartlookSetupConfig): void {
@@ -277,9 +216,6 @@ export class Smartlook extends IonicNativePlugin {
* @param config SmartlookSetupConfig object.
* @param config.smartlookAPIKey (required) Smartlook API key (you can obtain it in your dashboard).
* @param config.fps (optional) recorded video framerate (allowed values 2-10 fps).
* @param options.renderingMode (optional) Mode defining the video output of recording.
* @param options.startNewSession (optional) If true new session is going to be created
* @param options.startNewSessionAndUser (optional) If true new session and visitor is going to be created
*/
@Cordova({ sync: true })
setup(config: SmartlookSetupConfig): void {
@@ -311,16 +247,6 @@ export class Smartlook extends IonicNativePlugin {
return;
}
/**
* Resets current session and new session in dashboard is created.
* @param resetSession SmartlookResetSession object.
* @param resetSession.resetUser If set to TRUE new visitor is created in the dashboard.
*/
@Cordova({ sync: true })
resetSession(resetSession: SmartlookResetSession): void {
return;
}
/**
* When you start sensitive mode SDK records blank videos (single color) but SDK still sends analytic events.
*/
@@ -487,36 +413,11 @@ export class Smartlook extends IonicNativePlugin {
}
/**
* Obtain session URL leading to our dashboard.
* @param smartlookDashboardSessionUrl SmartlookDashboardSessionUrl object.
* @param smartlookDashboardSessionUrl.withCurrentTimestamp If set to TRUE record will start at current timestamp.
* @return {Promise<string>} Returns a promise with dashboard session URL string.
* Obtain sharable url to user's session leading to our dashboard.
* @return {Promise<string>} Returns a promise with dashboard URL string.
*/
@Cordova()
getDashboardSessionUrl(smartlookDashboardSessionUrl: SmartlookDashboardSessionUrl): Promise<string> {
return;
}
/**
* Obtain visitor URL leading to our dashboard.
* @return {Promise<string>} Returns a promise with dashboard visitor URL string.
*/
@Cordova()
getDashboardVisitorUrl(): Promise<string> {
return;
}
/**
* Integration listener can be used to obtain dashboard URL for current session and visitor.
* These URLs can be propagated to various analytic tools/SDKs.
* @param integrationListener SmartlookIntegrationListener object.
* @param integrationListener.onSessionReady Called when dashboard session URL is ready. Note that this URL can be accesed only by user
* that has access to Smartlook dashboard (it is not public share link).
* @param integrationListener.onVisitorReady Called when dashboard visitor URL is ready. Note that this URL can be accesed only by user
* that has access to Smartlook dashboard (it is not public share link).
*/
@Cordova({ sync: true })
registerIntegrationListener(integrationListener: SmartlookIntegrationListener): void {
getDashboardSessionUrl(): Promise<string> {
return;
}
@@ -529,12 +430,4 @@ export class Smartlook extends IonicNativePlugin {
setRenderingMode(renderingMode: SmartlookRenderingMode): void {
return;
}
/**
* Unregister Integration listener (@see registerIntegrationListener())
*/
@Cordova({ sync: true })
unregisterIntegrationListener(): void {
return;
}
}