Compare commits

..
33 Commits
Author SHA1 Message Date
Daniel Sogl 4337515961 chore(): update changelog 2019-08-09 11:17:23 +02:00
Daniel Sogl c0d4a2ee34 5.12.0 2019-08-09 11:17:15 +02:00
Daniel Sogl 1f7e6a5d02 chore(package): bump deps 2019-08-09 11:11:10 +02:00
Akshay DwivediandDaniel Sogl fd81a5e5b7 feat(file-chooser): add missing options param (#3136)
added missing optional parameter to support mime types
2019-08-09 11:09:22 +02:00
Eliran AssarafandDaniel Sogl f3b8e34091 fix(chooser): @param accept is supposed to be optional (#3134) 2019-08-09 11:08:20 +02:00
Matthew HarrisandDaniel Sogl 5cc91bc79a fix(background-geolocation): enum not string (#3131)
based on [this stackoverflow issue](https://stackoverflow.com/questions/57293829/argument-of-type-location-is-not-assignable-to-parameter-of-type-backgroundge/57302110#57302110) it seems passing the string causes problems in (some / all) scenarios
2019-08-09 11:07:39 +02:00
SrinidhiandDaniel Sogl e37a7221b1 doc(unvired-cordova-sdk): update doc (#3130)
* feat(unvired-cordova-sdk): support login via email

* fix(unvired-cordova-sdk): return typed promise object for user settings

* fix(unvired-cordova-sdk): change return type to string for guid()

* doc(unvired-cordova-sdk): doc update
2019-08-09 11:07:11 +02:00
BultjerCMCandDaniel Sogl 016023a7bb fix(ms-adal): use correct accessTokenType prop (#3128)
Removed a typo, which made the Access Token Type undefined all the time.
2019-08-09 11:06:38 +02:00
Matthew HarrisandDaniel Sogl 852df98647 docs(image-picker): set repo url to active repo (#3127)
Original repo hasn't had a commit since 2016. `Repo:` parameter already updated but intro docs wasn't.
2019-08-09 11:05:53 +02:00
jfgreffierandDaniel Sogl 7696706080 feat(http): add sendRequest responseType option (#3120) 2019-08-09 11:05:17 +02:00
Daniel SoglandGitHub 2c0aa4f124 fix(intercom): added logout, displayHelpCenter, sendPushTokenToIntercom (#3119) 2019-08-09 11:05:05 +02:00
František SpurnýandDaniel Sogl 8bcbc955e0 feat(smartlook): add plugin (#3117) 2019-08-09 11:04:51 +02:00
Maxim Belov 3bb6b59112 fix(intercom): added logout, displayHelpCenter, sendPushTokenToIntercom 2019-07-29 22:50:13 +03:00
Daniel Sogl f6e77db7b0 chore(): update changelog 2019-07-29 16:12:06 +02:00
Daniel Sogl acc587aca2 5.11.0 2019-07-29 16:12:00 +02:00
Daniel Sogl c77bdf17c1 chore(package): bump deps 2019-07-29 16:10:14 +02:00
Daniel SoglandGitHub 0c9bf3bf49 feat(urbanairship): add plugin (#3114)
feat(urbanairship): add plugin
2019-07-29 12:02:29 +02:00
Daniel SoglandGitHub f54b9e0797 doc(unvired-cordova-sdk): improve doc (#3108)
* feat(unvired-cordova-sdk): add plugin

* style(unvired-cordova-sdk): fix style

* doc(unvired-cordova-sdk): add doc

* doc(unvired-cordova-sdk): update doc

* style(unvired-cordova-sdk): fix style

* doc(unvired-cordova-sdk): fix readme errors

* doc(unvired-cordova-sdk): update doc

* doc(unvired-cordova-sdk): improve doc

* doc(unvired-cordova-sdk): remove clearFunction
2019-07-29 12:00:01 +02:00
Stéphane JAISandDaniel Sogl 7e08680d31 feat(wonderpush): add plugin (#3107) 2019-07-29 11:59:51 +02:00
patryk-fuhrmanandDaniel Sogl de83edb99b feat(cordova-plugin-firebasex): Add plugin (#3106) 2019-07-29 11:59:41 +02:00
Daniel SoglandGitHub fac94485a0 Update index.ts 2019-07-29 11:58:04 +02:00
Maxim Belov 9c9ed3518f feat(urbanship): add plugin 2019-07-29 01:53:09 +03:00
Srinidhi Anand Rao a0779de633 doc(unvired-cordova-sdk): remove clearFunction 2019-07-23 13:57:37 +05:30
Srinidhi Anand Rao 50408b08c6 Merge commit 'a2f5acb48c8d197fad55276ffcee7eee5cf3065f'
# Conflicts:
#	src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
2019-07-21 19:32:45 +05:30
Srinidhi Anand Rao 767391a4b4 doc(unvired-cordova-sdk): improve doc 2019-07-21 19:27:25 +05:30
Srinidhi Anand Rao 28ce962677 doc(unvired-cordova-sdk): update doc 2019-07-12 14:57:43 +05:30
Srinidhi Anand Rao f576c5f11e doc(unvired-cordova-sdk): fix readme errors 2019-07-05 17:14:52 +05:30
Srinidhi Anand Rao f488a75e26 Merge commit '2b684fadb179af64ac179e0a878b4ffdec0e85aa'
# Conflicts:
#	src/@ionic-native/plugins/unvired-cordova-sdk/index.ts
2019-07-05 15:44:16 +05:30
Srinidhi Anand Rao 55fb503d81 style(unvired-cordova-sdk): fix style 2019-07-05 15:16:14 +05:30
Srinidhi Anand Rao afe95a6752 doc(unvired-cordova-sdk): update doc 2019-07-05 13:15:01 +05:30
Srinidhi Anand Rao 2ca8bda8f7 doc(unvired-cordova-sdk): add doc 2019-07-04 18:12:29 +05:30
Srinidhi Rao 1b60247807 style(unvired-cordova-sdk): fix style 2019-06-14 14:08:58 +05:30
Srinidhi Rao b75f40c76e feat(unvired-cordova-sdk): add plugin 2019-06-14 13:41:48 +05:30
15 changed files with 3236 additions and 431 deletions
+31
View File
@@ -1,3 +1,33 @@
# [5.12.0](https://github.com/ionic-team/ionic-native/compare/v5.11.0...v5.12.0) (2019-08-09)
### Bug Fixes
* **background-geolocation:** enum not string ([#3131](https://github.com/ionic-team/ionic-native/issues/3131)) ([5cc91bc](https://github.com/ionic-team/ionic-native/commit/5cc91bc)), closes [/stackoverflow.com/questions/57293829/argument-of-type-location-is-not-assignable-to-parameter-of-type-backgroundge/57302110#57302110](https://github.com//stackoverflow.com/questions/57293829/argument-of-type-location-is-not-assignable-to-parameter-of-type-backgroundge/57302110/issues/57302110)
* **chooser:** [@param](https://github.com/param) accept is supposed to be optional ([#3134](https://github.com/ionic-team/ionic-native/issues/3134)) ([f3b8e34](https://github.com/ionic-team/ionic-native/commit/f3b8e34))
* **intercom:** added logout, displayHelpCenter, sendPushTokenToIntercom ([3bb6b59](https://github.com/ionic-team/ionic-native/commit/3bb6b59))
* **ms-adal:** use correct accessTokenType prop ([#3128](https://github.com/ionic-team/ionic-native/issues/3128)) ([016023a](https://github.com/ionic-team/ionic-native/commit/016023a))
### Features
* **file-chooser:** add missing options param ([#3136](https://github.com/ionic-team/ionic-native/issues/3136)) ([fd81a5e](https://github.com/ionic-team/ionic-native/commit/fd81a5e))
* **http:** add sendRequest responseType option ([#3120](https://github.com/ionic-team/ionic-native/issues/3120)) ([7696706](https://github.com/ionic-team/ionic-native/commit/7696706))
* **smartlook:** add plugin ([#3117](https://github.com/ionic-team/ionic-native/issues/3117)) ([8bcbc95](https://github.com/ionic-team/ionic-native/commit/8bcbc95))
# [5.11.0](https://github.com/ionic-team/ionic-native/compare/v5.10.0...v5.11.0) (2019-07-29)
### Features
* **cordova-plugin-firebasex:** Add plugin ([#3106](https://github.com/ionic-team/ionic-native/issues/3106)) ([de83edb](https://github.com/ionic-team/ionic-native/commit/de83edb))
* **urbanship:** add plugin ([9c9ed35](https://github.com/ionic-team/ionic-native/commit/9c9ed35))
* **wonderpush:** add plugin ([#3107](https://github.com/ionic-team/ionic-native/issues/3107)) ([7e08680](https://github.com/ionic-team/ionic-native/commit/7e08680))
# [5.10.0](https://github.com/ionic-team/ionic-native/compare/v5.9.0...v5.10.0) (2019-07-12)
@@ -30,6 +60,7 @@
* **calendar:** add deleteEventById function ([#3075](https://github.com/ionic-team/ionic-native/issues/3075)) ([5857b96](https://github.com/ionic-team/ionic-native/commit/5857b96))
* **diagnostic:** add DENIED_ONCE introduced by diagnostic v5 ([#3071](https://github.com/ionic-team/ionic-native/issues/3071)) ([54ac2bf](https://github.com/ionic-team/ionic-native/commit/54ac2bf))
* **sum-up:** add plugin ([#3080](https://github.com/ionic-team/ionic-native/issues/3080)) ([a4db080](https://github.com/ionic-team/ionic-native/commit/a4db080))
* **unvired-cordova-sdk:** add plugin ([b75f40c](https://github.com/ionic-team/ionic-native/commit/b75f40c))
* **unvired-cordova-sdk:** add plugin ([#3061](https://github.com/ionic-team/ionic-native/issues/3061)) ([9274083](https://github.com/ionic-team/ionic-native/commit/9274083))
+900 -374
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "5.10.0",
"version": "5.12.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)",
@@ -29,15 +29,15 @@
"@angular/core": "^7.2.15",
"@types/cordova": "0.0.34",
"@types/fs-extra": "^8.0.0",
"@types/jest": "^24.0.15",
"@types/jest": "^24.0.17",
"@types/lodash": "^4.14.136",
"@types/node": "^12.6.2",
"@types/node": "^12.7.1",
"@types/rimraf": "^2.0.2",
"@types/webpack": "^4.4.34",
"ajv": "^6.10.1",
"@types/webpack": "^4.32.1",
"ajv": "^6.10.2",
"async-promise-queue": "^1.0.5",
"conventional-changelog-cli": "^2.0.21",
"cz-conventional-changelog": "^2.1.0",
"conventional-changelog-cli": "^2.0.23",
"cz-conventional-changelog": "^3.0.2",
"dgeni": "^0.4.12",
"dgeni-packages": "0.16.10",
"fs-extra": "^8.1.0",
@@ -46,7 +46,7 @@
"gulp-replace": "^1.0.0",
"gulp-tslint": "^8.1.4",
"jest": "^24.8.0",
"lodash": "^4.17.14",
"lodash": "^4.17.15",
"minimist": "1.2.0",
"natives": "^1.1.6",
"rimraf": "^2.6.3",
@@ -55,11 +55,11 @@
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"tslint-ionic-rules": "0.0.21",
"typedoc": "^0.14.2",
"typedoc": "^0.15.0",
"typescript": "3.2.4",
"uglifyjs-webpack-plugin": "^2.1.3",
"uglifyjs-webpack-plugin": "^2.2.0",
"unminified-webpack-plugin": "^2.0.0",
"webpack": "^4.35.3",
"webpack": "^4.39.1",
"winston": "^3.2.1",
"zone.js": "^0.8.29"
},
@@ -499,7 +499,7 @@ export declare enum BackgroundGeolocationIOSActivity {
* BackgroundGeolocation must be called within app.ts and or before Geolocation. Otherwise the platform will not ask you for background tracking permission.
*
* ```typescript
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
* import { BackgroundGeolocation, BackgroundGeolocationConfig, BackgroundGeolocationEvents, BackgroundGeolocationResponse } from '@ionic-native/background-geolocation';
*
* constructor(private backgroundGeolocation: BackgroundGeolocation) { }
*
@@ -516,7 +516,7 @@ export declare enum BackgroundGeolocationIOSActivity {
* this.backgroundGeolocation.configure(config)
* .then(() => {
*
* this.backgroundGeolocation.on('location').subscribe((location: BackgroundGeolocationResponse) => {
* this.backgroundGeolocation.on(BackgroundGeolocationEvents.location).subscribe((location: BackgroundGeolocationResponse) => {
* console.log(location);
*
* // IMPORTANT: You must execute the finish method here to inform the native plugin that you're finished,
+1 -1
View File
@@ -61,7 +61,7 @@ export class Chooser extends IonicNativePlugin {
* base64-encoded data: URI, MIME type, display name, and original URI.
*/
@Cordova()
getFile(accept: string): Promise<ChooserResult | undefined> {
getFile(accept?: string): Promise<ChooserResult | undefined> {
return;
}
}
@@ -1,6 +1,13 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface FileChooserOptions {
/**
* comma seperated mime types to filter files.
*/
mime: string;
}
/**
* @name File Chooser
* @description
@@ -20,6 +27,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* .catch(e => console.log(e));
*
* ```
* @interfaces
* FileChooserOptions
*/
@Plugin({
pluginName: 'FileChooser',
@@ -33,10 +42,11 @@ export class FileChooser extends IonicNativePlugin {
/**
* Open a file
* @param {FileChooserOptions} [options] Optional parameter, defaults to ''. Filters the file selection list according to mime types
* @returns {Promise<string>}
*/
@Cordova()
open(): Promise<string> {
open(options?: FileChooserOptions): Promise<string> {
return;
}
@@ -0,0 +1,527 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
export interface IChannelOptions {
/**
* Channel ID - must be unique per app package
*/
id: string;
/**
* Channel name. Default: empty string
*/
name?: string;
/**
* The sound to play once a push comes. Default value: 'default'
* Values allowed:
* 'default' - plays the default notification sound
* 'ringtone' - plays the currently set ringtone
* 'false' - silent; don't play any sound
* filename - the filename of the sound file located in '/res/raw' without file extension (mysound.mp3 -> mysound)
*/
sound?: string;
/**
* Vibrate on new notification. Default value: true
* Possible values:
* Boolean - vibrate or not
* Array - vibration pattern - e.g. [500, 200, 500] - milliseconds vibrate, milliseconds pause, vibrate, pause, etc.
*/
vibration?: boolean;
/**
* Whether to blink the LED
*/
light?: boolean;
/**
* LED color in ARGB format - this example BLUE color. If set to -1, light color will be default. Default value: -1.
*/
lightColor?: string;
/**
* Importance - integer from 0 to 4. Default value: 4
* 0 - none - no sound, does not show in the shade
* 1 - min - no sound, only shows in the shade, below the fold
* 2 - low - no sound, shows in the shade, and potentially in the status bar
* 3 - default - shows everywhere, makes noise, but does not visually intrude
* 4 - high - shows everywhere, makes noise and peeks
*/
importance?: 0 | 1 | 2 | 3 | 4;
/**
* Show badge over app icon when non handled pushes are present. Default value: true
*/
badge?: boolean;
/**
* Show message on locked screen. Default value: 1
* Possible values (default 1):
* -1 - secret - Do not reveal any part of the notification on a secure lockscreen.
* 0 - private - Show the notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.
* 1 - public - Show the notification in its entirety on all lockscreens.
*/
visibility?: -1 | 0 | 1;
}
/**
* @name Firebase X
* @description
* This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported.
* It is a maintained fork from unmaintained ionic-navite plugin called Firebase.
*
* @usage
* ```typescript
* import { FirebaseX } from '@ionic-native/firebase-x';
*
*
* constructor(private firebaseX: FirebaseX) { }
*
* ...
*
*
* this.firebaseX.getToken()
* .then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
* .catch(error => console.error('Error getting token', error));
*
* this.firebaseX.onMessageReceived()
* .subscribe(data => console.log(`User opened a notification ${data}`));
*
* this.firebaseX.onTokenRefresh()
* .subscribe((token: string) => console.log(`Got a new token ${token}`));
* ```
* @interfaces
* IChannelOptions
*
*/
@Plugin({
pluginName: 'FirebaseX',
plugin: 'cordova-plugin-firebasex',
pluginRef: 'FirebasePlugin',
repo: 'https://github.com/dpa99c/cordova-plugin-firebasex',
platforms: ['Android', 'iOS']
})
@Injectable()
export class FirebaseX extends IonicNativePlugin {
/**
* Get the device token.
* @return {Promise<null | string>} Note that token will be null if it has not been established yet
*/
@Cordova()
getToken(): Promise<null | string> {
return;
}
/**
* Get notified when a token is refreshed.
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
onTokenRefresh(): Observable<any> {
return;
}
/**
* Registers a callback function to invoke when:
* - a notification or data message is received by the app
* - a system notification is tapped by the user
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
onMessageReceived(): Observable<any> {
return;
}
/**
* Grant permission to receive push notifications (will trigger prompt) and return hasPermission: true. iOS only (Android will always return true).
* @return {Promise<any>}
*/
@Cordova({
platforms: ['iOS']
})
grantPermission(): Promise<any> {
return;
}
/**
* Check permission to receive push notifications and return hasPermission: true. iOS only (Android will always return true).
* @return {Promise<{isEnabled: boolean}>}
*/
@Cordova()
hasPermission(): Promise<{ isEnabled: boolean }> {
return;
}
/**
* Unregister from firebase, used to stop receiving push notifications. Call this when you logout user from your app.
*/
@Cordova()
unregister(): Promise<any> {
return;
}
/**
* Set a number on the icon badge. Set 0 to clear the badge
* @param {number} badgeNumber
* @return {Promise<any>}
*/
@Cordova()
setBadgeNumber(badgeNumber: number): Promise<any> {
return;
}
/**
* Get icon badge number.
* @return {Promise<any>}
*/
@Cordova()
getBadgeNumber(): Promise<any> {
return;
}
/**
* Clear all pending notifications from the drawer.
* @return {Promise<any>}
*/
@Cordova({
platforms: ['Android']
})
clearAllNotifications(): Promise<any> {
return;
}
/**
* Subscribe to a topic. Topic messaging allows you to send a message to multiple devices that have opted in to a particular topic.
* @param {string} topic
* @return {Promise<any>}
*/
@Cordova()
subscribe(topic: string): Promise<any> {
return;
}
/**
* Unsubscribe from a topic. This will stop you receiving messages for that topic.
* @param {string} topic
* @return {Promise<any>}
*/
@Cordova()
unsubscribe(topic: string): Promise<any> {
return;
}
/**
* Android 8+ only. Creates a custom channel to be used by notification messages which have the channel property set in the message payload to the id of the created channel:
* - for background (system) notifications: android.notification.channel_id
* - for foreground/data notifications: data.notification_android_channel_id
*
* Calling on Android 7 or below or another platform will have no effect.
* @param {IChannelOptions} channelOptions
* @return {Promise<any>}
*/
@Cordova()
createChannel(channelOptions: IChannelOptions): Promise<any> {
return;
}
/**
* Android 8+ only. Overrides the properties for the default channel.
* The default channel is used if no other channel exists or is specified in the notification.
* Any options not specified will not be overridden. Should be called as soon as possible (on app start) so default notifications will work as expected.
* Calling on Android 7 or below or another platform will have no effect.
* @param {IChannelOptions} channelOptions
* @return {Promise<any>}
*/
@Cordova()
setDefaultChannel(channelOptions: IChannelOptions): Promise<any> {
return;
}
/**
* Android 8+ only. Removes a previously defined channel.
* Calling on Android 7 or below or another platform will have no effect.
* @param {string} channelID
* @return {Promise<any>}
*/
@Cordova()
deleteChannel(channelID: string): Promise<any> {
return;
}
/**
* Android 8+ only. Gets a list of all channels.
* Calling on Android 7 or below or another platform will have no effect.
* @return {Promise<any>}
*/
@Cordova()
listChannels(): Promise<any> {
return;
}
/**
* Enable/disable analytics collection (useful for GDPR/privacy settings).
* @param {boolean} enabled
* @returns {Promise<any>}
*/
@Cordova()
setAnalyticsCollectionEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Log an event using Analytics
* @param {string} type
* @param {Object} data
* @return {Promise<any>}
*/
@Cordova()
logEvent(type: string, data: any): Promise<any> {
return;
}
/**
* Set the name of the current screen in Analytics
* @param {string} name Screen name
* @return {Promise<any>}
*/
@Cordova()
setScreenName(name: string): Promise<any> {
return;
}
/**
* Set a user id for use in Analytics
* @param {string} userId
* @return {Promise<any>}
*/
@Cordova()
setUserId(userId: string): Promise<any> {
return;
}
/**
* Set a user property for use in Analytics
* @param {string} name
* @param {string} value
* @return {Promise<any>}
*/
@Cordova()
setUserProperty(name: string, value: string): Promise<any> {
return;
}
/**
* Set Crashlytics user identifier.
* To diagnose an issue, its often helpful to know which of your users experienced a given crash.
* Crashlytics includes a way to anonymously identify users in your crash reports.
* To add user IDs to your reports, assign each user a unique identifier in the form of an ID number, token, or hashed value.
*
* More info https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#set_user_ids
* @param {string} userId
* @returns {Promise<any>}
*/
@Cordova()
setCrashlyticsUserId(userId: string): Promise<any> {
return;
}
/**
* Simulates (causes) a fatal native crash which causes a crash event to be sent to Crashlytics (useful for testing).
* See the Firebase documentation regarding crash testing.
* Crashes will appear under Event type = "Crashes" in the Crashlytics console.
* @return {Promise<any>}
*/
@Cordova()
sendCrash(): Promise<any> {
return;
}
/**
* Sends a crash-related log message that will appear in the Logs section of the next native crash event.
* Note: if you don't then crash, the message won't be sent! Also logs the message to the native device console.
* @param {string} message
* @return {Promise<any>}
*/
@Cordova()
logMessage(message: string): Promise<any> {
return;
}
/**
* Sends a non-fatal error event to Crashlytics. In a Cordova app, you may use this to log unhandled Javascript exceptions, for example.
* The event will appear under Event type = "Non-fatals" in the Crashlytics console.
* The error message will appear in the Logs section of the non-fatal error event.
* Also logs the error message to the native device console.
* @param {string} error
* @return {Promise<any>}
*/
@Cordova()
logError(error: string): Promise<any> {
return;
}
/**
* Request a verification ID and send a SMS with a verification code. Use them to construct a credential to sign in the user (in your app).
*
* More info:
* https://github.com/dpa99c/cordova-plugin-firebasex#verifyphonenumber
* https://firebase.google.com/docs/auth/android/phone-auth
* https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithCredential
* https://firebase.google.com/docs/reference/js/firebase.User#linkWithCredential
*
* NOTE: This will only work on physical devices.
*
* iOS will return: credential (string)
*
* Android will return:
* credential.verificationId (object and with key verificationId)
* credential.instantVerification (boolean) credential.code (string)
* (note that this key only exists if instantVerification is true)
*
* You need to use device plugin in order to access the right key.
* IMPORTANT NOTE: Android supports auto-verify and instant device verification.
* Therefore in that case it doesn't make sense to ask for an sms code as you won't receive one.
* In this case you'll get a credential.verificationId and a credential.code where code is the auto received verification code
* that would normally be sent via sms. To log in using this procedure you must pass this code to
* PhoneAuthProvider.credential(verificationId, code). You'll find an implementation example further below.
*
* When using node.js Firebase Admin-SDK, follow this tutorial:
* https://firebase.google.com/docs/auth/admin/create-custom-tokens
*
* Pass back your custom generated token and call
* firebase.auth().signInWithCustomToken(customTokenFromYourServer);
* instead of
* firebase.auth().signInWithCredential(credential)
*
* YOU HAVE TO COVER THIS PROCESS, OR YOU WILL HAVE ABOUT 5% OF USERS STICKING ON YOUR SCREEN, NOT RECEIVING ANYTHING
* If this process is too complex for you, use this awesome plugin
* https://github.com/chemerisuk/cordova-plugin-firebase-authentication
* It's not perfect but it fits for the most use cases and doesn't require calling your endpoint, as it has native phone auth support.
*
* Android
* To use this auth you need to configure your app SHA hash in the android app configuration in the firebase console.
* See https://developers.google.com/android/guides/client-auth to know how to get SHA app hash.
*
* iOS
* Setup your push notifications first, and verify that they are arriving on your physical device before you test this method.
* Use the APNs auth key to generate the .p8 file and upload it to firebase. When you call this method,
* FCM sends a silent push to the device to verify it.
*
* @param {string} phoneNumber The phone number, including '+' and country code
* @param {number} timeoutDuration (Android only) The timeout in sec - no more SMS will be sent to this number until this timeout expires
* @returns {Promise<any>}
*/
@Cordova()
verifyPhoneNumber(
phoneNumber: string,
timeoutDuration = 0
): Promise<any> {
return;
}
/**
* Fetch Remote Config parameter values for your app.
* @param {number} cacheExpirationSeconds specify the cacheExpirationSeconds
* @return {Promise<any>}
*/
@Cordova()
fetch(cacheExpirationSeconds?: number): Promise<any> {
return;
}
/**
* Activate the Remote Config fetched config.
* @return {Promise<any>}
*/
@Cordova()
activateFetched(): Promise<any> {
return;
}
/**
* Retrieve a Remote Config value.
* @param {string} key
* @return {Promise<any>}
*/
@Cordova()
getValue(key: string): Promise<any> {
return;
}
/**
* Android only. Retrieve a Remote Config byte array.
* @param {string} key
* @return {Promise<any>}
*/
@Cordova()
getByteArray(key: string): Promise<any> {
return;
}
/**
* Android only. Get the current state of the FirebaseRemoteConfig singleton object.
* @return {Promise<any>}
*/
@Cordova()
getInfo(): Promise<any> {
return;
}
/**
* Android only. Change the settings for the FirebaseRemoteConfig object's operations.
* @param {Object} settings
* @return {Promise<any>}
*/
@Cordova()
setConfigSettings(settings: any): Promise<any> {
return;
}
/**
* Android only. Set defaults in the Remote Config.
* @param {Object} settings
* @return {Promise<any>}
*/
@Cordova()
setDefaults(settings: any): Promise<any> {
return;
}
/**
* Start a trace.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
startTrace(name: string): Promise<any> {
return;
}
/**
* To count the performance-related events that occur in your app (such as cache hits or retries),
* add a line of code similar to the following whenever the event occurs,
* using a string other than retry to name that event if you are counting a different type of event.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
incrementCounter(name: string): Promise<any> {
return;
}
/**
* Stop the trace.
* @param {string} name
* @return {Promise<any>}
*/
@Cordova()
stopTrace(name: string): Promise<any> {
return;
}
}
+2
View File
@@ -306,6 +306,7 @@ export class HTTP extends IonicNativePlugin {
* @param options.headers {Object} headers object (key value pair), will be merged with global values
* @param options.filePath {string} filePath to be used during upload and download see uploadFile and downloadFile for detailed information
* @param options.name {string} name to be used during upload see uploadFile for detailed information
* @param options.responseType {string} response type, defaults to text
*
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
*/
@@ -321,6 +322,7 @@ export class HTTP extends IonicNativePlugin {
headers?: { [index: string]: string };
filePath?: string;
name?: string;
responseType?: 'text' | 'arraybuffer' | 'blob';
}
): Promise<HTTPResponse> {
return;
@@ -42,7 +42,7 @@ export enum OutputType {
* Cordova Plugin For Multiple Image Selection
*
* Requires Cordova plugin: `cordova-plugin-image-picker`.
* For more info, please see the https://github.com/wymsee/cordova-imagePicker
* For more info, please see the https://github.com/Telerik-Verified-Plugins/ImagePicker
*
* @usage
* ```typescript
@@ -61,6 +61,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
logout(): Promise<any> {
return;
}
/**
*
* @param secureHash {string}
@@ -141,6 +150,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
*/
@Cordova()
displayHelpCenter(): Promise<any> {
return;
}
/**
*
* @return {Promise<any>} Returns a promise
@@ -188,4 +206,15 @@ export class Intercom extends IonicNativePlugin {
return;
}
/**
*
* @param token {string}
* @return {Promise<any>} Returns a promise
*/
@Cordova()
sendPushTokenToIntercom(token: string): Promise<any> {
return;
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ import { CordovaInstance, InstanceProperty, IonicNativePlugin, Plugin, checkAvai
export interface AuthenticationResult {
accessToken: string;
accesSTokenType: string;
accessTokenType: string;
expiresOn: Date;
idToken: string;
isMultipleResourceRefreshToken: boolean;
@@ -0,0 +1,249 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export class SmartlookSetupConfig {
private smartlookAPIKey: string;
private fps: number;
constructor(smartlookAPIKey: string, fps?: number) {
this.smartlookAPIKey = smartlookAPIKey;
this.fps = fps;
}
}
export class SmartlookUserIdentifier {
private identifier: string;
private sessionProperties: {};
constructor(identifier: string, sessionProperties?: {}) {
this.identifier = identifier;
this.sessionProperties = sessionProperties;
}
}
export class SmartlookCustomEvent {
private name: string;
private eventProperties: {};
constructor(name: string, eventProperties?: {}) {
this.name = name;
this.eventProperties = eventProperties;
}
}
export class SmartlookGlobalEventProperties {
private globalEventProperties: {};
private immutable: boolean;
constructor(globalEventProperties: {}, immutable: boolean) {
this.globalEventProperties = globalEventProperties;
this.immutable = immutable;
}
}
export class SmartlookGlobalEventProperty {
private key: string;
private value: string;
private immutable: boolean;
constructor(key: string, value: string, immutable: boolean) {
this.key = key;
this.value = value;
this.immutable = immutable;
}
}
export class SmartlookGlobalEventPropertyKey {
private key: string;
constructor(key: string) {
this.key = key;
}
}
/**
* @name Smartlook
* @description
* Official Smartlook SDK plugin. For more information visit (www.smartlook.com).
*
* @usage
* ```typescript
* import { Smartlook } from '@ionic-native/smartlook/ngx';
*
*
* constructor(private smartlook: Smartlook) { }
*
* ...
*
*
* this.smartlook.setupAndStartRecording(new SmartlookSetupConfig("key"));
*
* ```
* @classes
* SmartlookSetupConfig
* SmartlookUserIdentifier
* SmartlookCustomEvent
* SmartlookGlobalEventProperties
* SmartlookGlobalEventProperty
* SmartlookGlobalEventPropertyKey
*/
@Plugin({
pluginName: 'Smartlook',
plugin: 'https://github.com/smartlook/cordova-smartlook.git',
pluginRef: 'cordova.plugins.SmartlookPlugin',
repo: 'https://github.com/smartlook/cordova-smartlook.git',
platforms: ['Android']
})
@Injectable()
export class Smartlook extends IonicNativePlugin {
/**
* Setup and start Smartlook SDK recording.
* @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).
*/
@Cordova({ sync: true })
setupAndStartRecording(config: SmartlookSetupConfig): void {
return;
}
/**
* Setup/initialize Smartlook SDK. This method DOESN'T start the recording (@see start())
* @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).
*/
@Cordova({ sync: true })
setup(config: SmartlookSetupConfig): void {
return;
}
/**
* Start SDK recording.
*/
@Cordova({ sync: true })
startRecording(): void {
return;
}
/**
* Stop SDK recording. Recording will start again when you call start().
*/
@Cordova({ sync: true })
stopRecording(): void {
return;
}
/**
* Check if SDK is currently recording.
* @return {Promise<boolean>} Returns a promise with isRecording boolean.
*/
@Cordova()
isRecording(): Promise<boolean> {
return;
}
/**
* When you start sensitive mode SDK records blank videos (single color) but SDK still sends analytic events.
*/
@Cordova({ sync: true })
startFullscreenSensitiveMode(): void {
return;
}
/**
* Stop sensitive mode -> SDK records video.
*/
@Cordova({ sync: true })
stopFullscreenSensitiveMode(): void {
return;
}
/**
* Check if fullscreen sensitive mode is active.
* @return {Promise<boolean>} Returns a promise with isFullscreenSensitiveModeActive boolean.
*/
@Cordova()
isFullscreenSensitiveModeActive(): Promise<boolean> {
return;
}
/**
* Identify user.
* @param identifier SmartlookUserIdentifier object.
* @param identifier.idenfier (required) id that can be used to identify user and his records.
* You will see this Id in Smartlook dashboard so you can pair records with concrete user.
* @param identifier.sessionProperties (optional) custom session properties object.
*/
@Cordova({ sync: true })
setUserIdentifier(identifier: SmartlookUserIdentifier): void {
return;
}
/**
* Track custom event.
* @param event SmartlookCustomEvent object.
* @param event.name (required) string used to identify event.
* @param event.eventProperties (optional) event properties object.
*/
@Cordova({ sync: true })
trackCustomEvent(event: SmartlookCustomEvent): void {
return;
}
/**
* Track custom event.
* @param timedEvent SmartlookCustomEvent object.
* @param timedEvent.name (required) string used to identify timed event.
* @param timedEvent.eventProperties (optional) timed event properties object. These properties will
* be merged with properties of tracked event (with lower priority).
*/
@Cordova({ sync: true })
startTimedCustomEvent(timedEvent: SmartlookCustomEvent): void {
return;
}
/**
* Set global event properties that will be added to every tracked event.
* @param properties SmartlookGlobalEventProperties object.
* @param properties.globalEventProperties (required) global event properties object.
* @param properties.immutable (required) If set to TRUE these properties have higher priority
* than mutable ones and also they cannot be changed (only removed).
*/
@Cordova({ sync: true })
setGlobalEventProperties(properties: SmartlookGlobalEventProperties): void {
return;
}
/**
* Check if SDK is currently recording.
* @param property SmartlookGlobalEventProperty object.
* @param property.key global property key.
* @param property.value global property value.
* @param property.immutable (required) If set to TRUE these properties have higher priority
* than mutable ones and also they cannot be changed (only removed).
*/
@Cordova({ sync: true })
setGlobalEventProperty(property: SmartlookGlobalEventProperty): void {
return;
}
/**
* Remove property from global event properties.
* @param property SmartlookGlobalEventPropertyKey object.
* @param property.key global property key.
*/
@Cordova({ sync: true })
removeGlobalEventProperty(property: SmartlookGlobalEventPropertyKey): void {
return;
}
/**
* Remove all properties from global event properties.
*/
@Cordova({ sync: true })
removeAllGlobalEventProperties(): void {
return;
}
}
@@ -62,7 +62,7 @@ export enum LoginListenerType {
*/
auth_activation_required = 0,
/**
* Applicable for iOS, Android & Windows.
* Applicable for mobile.
* This value indicates user needs to login before using the app. This depends on the setting LOCAL_PASSWORD which is set in UMP Admin Cockpit.
* If LOCAL_PASSWORD is set to true, this type is set everytime user opens the app.
*/
@@ -117,6 +117,11 @@ export enum LoginType {
* ```
*/
sap = 'SAP',
/**
* EMAIL
* Set the type to email to login based on email id.
*/
email = 'EMAIL',
/**
* TODO:
*/
@@ -543,7 +548,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported for iOS, Android & Windows Platforms.
* Supported for mobile Platforms.
* Display framework settings.
*/
@Cordova()
@@ -555,7 +560,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Get User settings.
*/
@Cordova()
userSettings(): Promise<any> {
userSettings(): Promise<SettingsResult> {
return;
}
@@ -603,8 +608,8 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/**
* Get a random id to use as guid.
*/
@Cordova()
guid() {
@Cordova({ sync: true })
guid(): string {
return;
}
@@ -627,10 +632,13 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/**
* Select records from Database
* @param tableName table name. Example: CUSTOMER_HEADER
* @param whereClause {Object} JSON object containing name-value pairs.
* @param whereClause {Object} Browser: JSON object containing name-value pairs.
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
* Example:
* ```
* # Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Mobile: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbSelect('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
* # Mobile & Browser: Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* this.unviredSDK.dbSelect('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@@ -676,11 +684,15 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/**
* Delete records from the database.
* @param tableName Name of the table
* @param whereClause {Object} JSON object containing name-value pairs.
* @param whereClause {Object} Browser: JSON object containing name-value pairs.
* Mobile: Or a Sqlite whereClause ( without the 'where' keyword )
* Example:
* ```
* # Delete CUSTOMER_HEADER where F_NAME equals TARAK
* this.unviredSDK.dbDelete('CUSTOMER_HEADER', {'F_NAME':'TARAK'})
* Select values from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Mobile
* this.unviredSDK.dbDelete('FORM_HEADER', "FORM_ID = '5caed815892215034dacad56'")
* # Browser & Mobile
* this.unviredSDK.dbDelete('FORM_HEADER', {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@Cordova()
@@ -691,12 +703,16 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
/**
* Update records in database.
* @param tableName Name of the table
* @param updatedObject JSON object containing name-value pairs.
* @param whereClause {Object} JSON object containing name-value pairs.
* @param updatedObject JSON object containing updateds name-value pairs.
* @param whereClause {Object} Browser: JSON object containing name-value pairs.
* Mobile: Or a Sqlite where Clause ( without the 'where' keyword )
* Example:
* ```
* # Update TEAM_NAME of TEAMS_HEADER for team matching TEAM_ID = 8B75B4DB7F134DE08CF446889433B9CC
* this.unviredSDK.dbUpdate('TEAMS_HEADER', {'TEAM_NAME': 'SUPPORT'}, {'TEAM_ID': '8B75B4DB7F134DE08CF446889433B9CC' })
* Update NAME & NO from FORM_HEADER table where FORM_ID is 5caed815892215034dacad56
* # Mobile
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"TARAK","NO":"0039"}, "FORM_ID = '5caed815892215034dacad56'")
* # Mobile & Browser
* this.unviredSDK.dbUpdate('FORM_HEADER', {"NAME":"TARAK","NO":"0039"}, {"FORM_ID": "5caed815892215034dacad56"})
* ```
*/
@Cordova()
@@ -705,7 +721,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* Execute SQL Statement
* @param query {string} SQL Statement.
* Example:
@@ -719,7 +735,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* Create Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of savepoint
* Example:
@@ -733,7 +749,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* Release Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of savepoint
* ```
@@ -746,7 +762,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* Rollback Savepoint. For more info consult SQLite Documentation ( https://www.sqlite.org/lang_savepoint.html )
* @param savePoint {string} Name of the savepoint
* Example:
@@ -760,7 +776,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* Begin database transaction.
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
* Example:
@@ -774,7 +790,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only.
* Supported in mobile only.
* End database transaction.
* For more info, consult SQLite documentation ( https://www.sqlite.org/lang_transaction.html )
* Example:
@@ -867,14 +883,14 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* For PA functions which do not accept any input, set an empty string for this parameter.
* Example: If Header datastructure needs to be sent, make sure the header datastructure is in the following format:
* ```
* {"CUSTOMER_HEADER": {field_name : field_value,...}}
* {"CUSTOMER_HEADER": {"field1" : "value1", "field2" : "value2"}}
* ```
* @param customData {Object} This depends on the PA function. This is useful if you want to send custom data to a PA function.
* Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this.
* ```
* {
* "CATEGORY_BE": [{
* "CATEGORY_HEADER": {field_name : field_value,...}
* "CATEGORY_HEADER": {"field1" : "value1", "field2" : "value2"}
* }]
* }
* ```
@@ -894,14 +910,14 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* For PA functions which do not accept any input, set an empty string for this parameter.
* Example: If Header datastructure needs to be sent, make sure the header datastructure is in the following format:
* ```
* {"CUSTOMER_HEADER": {field_name : field_value,...}}
* {"CUSTOMER_HEADER": {"field1" : "value1", "field2" : "value2"}}
* ```
* @param customData {Object} This depends on the PA function. This is useful if you want to send custom data to a PA function.
* Example: You can also use this parameter to send header datastrucrture provided the data structure is formatted like this.
* ```
* {
* "CATEGORY_BE": [{
* "CATEGORY_HEADER": {field_name : field_value,...}
* "CATEGORY_HEADER": {"field1" : "value1", "field2" : "value2"}
* }]
* }
* ```
@@ -971,23 +987,14 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
* Only one class can subscribe to notifications are any point of time.
*/
@Cordova({
observable: true,
clearFunction: 'unRegisterNotifListener'
observable: true
})
registerNotifListener(): Observable<NotifResult> {
return;
}
/**
* Unregister the notification listener previously registered.
*/
@Cordova()
unRegisterNotifListener(): Promise<any> {
return;
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Check whether a Header datastructure is in outbox.
* @param beLid LID of the Header datastructure.
*/
@@ -997,7 +1004,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Returns the count of outbox items.
*/
@Cordova()
@@ -1006,7 +1013,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Checks whether a Header datastructure is in sent and is waiting for response.
* Typically you would use before allowing the user to update the Header datastructure.
* @param beLid LID of the Business Entity
@@ -1017,7 +1024,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Returns the count of sent items.
*/
@Cordova()
@@ -1026,7 +1033,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Returns the count of Inbox items.
*/
@Cordova()
@@ -1035,7 +1042,7 @@ export class UnviredCordovaSDK extends IonicNativePlugin {
}
/**
* Supported in iOS, Android & Windows only
* Supported in mobile only
* Delete outbox entry for a Header datastructure.
* @param beLid LID of the Business Entity
*/
@@ -0,0 +1,819 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
export interface TagGroupEditor {
addTags(): void;
removeTags(): void;
apply(): void;
}
/**
* Enum for notification types.
* @readonly
* @enum {number}
*/
export enum NotificationType {
none = 0,
badge = 1,
sound = 2,
alert = 4
}
/**
* Enum for presentation options.
* @readonly
* @enum {number}
*/
export enum PresentationOptions {
none = 0,
badge = 1,
sound = 2,
alert = 4
}
/**
* @name UrbanAirShip
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { UrbanAirShip } from '@ionic-native/urbanairship/ngx';
*
*
* constructor(private urbanAirShip: UrbanAirShip) { }
*
* ...
*
*
* this.urbanAirShip.takeOff(config)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'UrbanAirShip',
plugin: 'urbanairship-cordova',
pluginRef: 'window.UAirship',
repo: 'https://www.npmjs.com/package/urbanairship-cordova',
install: 'ionic cordova plugin add urbanairship-cordova',
platforms: ['Android', 'iOS']
})
@Injectable()
export class UrbanAirShip extends IonicNativePlugin {
/**
* Re-attaches document event listeners in this webview
*/
@Cordova()
reattach(): Promise<any> {
return;
}
/**
* Initailizes Urban Airship.
*
* The plugin will automatically call takeOff during the next app init in
* order to properly handle incoming push. If takeOff is called multiple times
* in a session, or if the config is different than the previous sesssion, the
* new config will not be used until the next app start.
*
* @param {object} config The Urban Airship config.
* @param {object} config.development The Urban Airship development config.
* @param {string} config.development.appKey The development appKey.
* @param {string} config.development.appSecret The development appSecret.
* @param {object} config.production The Urban Airship production config.
* @param {string} config.production.appKey The production appKey.
* @param {string} config.production.appSecret The production appSecret.
*/
@Cordova()
takeOff(config: any): Promise<any> {
return;
}
/**
* Sets the Android notification config. Values not set will fallback to any values set in the config.xml.
*
* @param {object} config The notification config.
* @param {string} [config.icon] The name of the drawable resource to use as the notification icon.
* @param {string} [config.largeIcon] The name of the drawable resource to use as the notification large icon.
* @param {string} [config.accentColor] The notification accent color. Format is #AARRGGBB.
*/
@Cordova()
setAndroidNotificationConfig(config: any): Promise<any> {
return;
}
/**
* Sets the default behavior when the message center is launched from a push
* notification. If set to false the message center must be manually launched.
*
* @param {boolean} enabled true to automatically launch the default message center, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setAutoLaunchDefaultMessageCenter(enabled: boolean): Promise<any> {
return;
}
/**
* Enables or disables user notifications.
*
* @param {boolean} enabled true to enable notifications, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setUserNotificationsEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if user notifications are enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if user notifications is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isUserNotificationsEnabled(): Promise<any> {
return;
}
/**
* Checks if app notifications are enabled or not. Its possible to have `userNotificationsEnabled`
* but app notifications being disabled if the user opted out of notifications.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if app notifications is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isAppNotificationsEnabled(): Promise<any> {
return;
}
/**
* Returns the channel ID.
*
* @param {function(ID)} success The function to call on success.
* @param {string} success.ID The channel ID string
* @param {failureCallback} [failure] The function to call on failure.
* @param {string} failure.message The error message.
*/
@Cordova()
getChannelID(): Promise<any> {
return;
}
/**
* Returns the last notification that launched the application.
*
* @param {Boolean} clear true to clear the notification.
* @param {function(push)} success The function to call on success.
* @param {object} success.push The push message object containing data associated with a push notification.
* @param {string} success.push.message The push alert message.
* @param {object} success.push.extras Any push extras.
* @param {number} [success.push.notification_id] The Android notification ID.
* @param {failureCallback} [failure] The function to call on failure.
* @param {string} failure.message The error message.
*/
@Cordova()
getLaunchNotification(clear: boolean): Promise<any> {
return;
}
/**
* Returns the last received deep link.
*
* @param {Boolean} clear true to clear the deep link.
* @param {function(push)} success The function to call on success.
* @param {string} success.deepLink The deep link.
* @param {failureCallback} [failure] The function to call on failure.
* @param {string} failure.message The error message.
*/
@Cordova()
getDeepLink(clear: boolean): Promise<any> {
return;
}
/**
* Returns the tags as an array.
*
* @param {function(tags)} success The function to call on success.
* @param {array} success.tags The tags as an array.
* @param {failureCallback} [failure] The function to call on failure.
* @param {string} failure.message The error message.
*/
@Cordova()
getTags(): Promise<any> {
return;
}
/**
* Sets the tags.
*
* @param {Array} tags an array of strings.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setTags(tags: string[]): Promise<any> {
return;
}
/**
* Returns the alias.
*
* @deprecated Deprecated since 6.7.0 - to be removed in a future version of the plugin - please use getNamedUser
*
* @param {function(currentAlias)} success The function to call on success.
* @param {string} success.currentAlias The alias as a string.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
getAlias(): Promise<any> {
return;
}
/**
* Sets the alias.
*
* @deprecated Deprecated since 6.7.0 - to be removed in a future version of the plugin - please use setNamedUser
*
* @param {String} alias string
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setAlias(alias: string): Promise<any> {
return;
}
/**
* Checks if quiet time is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if quiet time is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isQuietTimeEnabled(): Promise<any> {
return;
}
/**
* Enables or disables quiet time.
*
* @param {Boolean} enabled true to enable quiet time, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setQuietTimeEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if the device is currently in quiet time.
*
* @param {function(inQuietTime)} success Success callback.
* @param {boolean} success.inQuietTime Flag indicating if quiet time is currently in effect.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isInQuietTime(): Promise<any> {
return;
}
/**
* Returns the quiet time as an object with the following:
* "startHour": Number,
* "startMinute": Number,
* "endHour": Number,
* "endMinute": Number
*
* @param {function(quietTime)} success The function to call on success.
* @param {object} success.quietTime The quietTime object represents a timespan during
* which notifications should be silenced.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
getQuietTime(): Promise<any> {
return;
}
/**
* Sets the quiet time.
*
* @param {Number} startHour for quiet time.
* @param {Number} startMinute for quiet time.
* @param {Number} endHour for quiet time.
* @param {Number} endMinute for quiet time.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setQuietTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise<any> {
return;
}
/**
* Enables or disables analytics.
*
* Disabling analytics will delete any locally stored events
* and prevent any events from uploading. Features that depend on analytics being
* enabled may not work properly if it's disabled (reports, region triggers,
* location segmentation, push to local time).
*
* @param {Boolean} enabled true to enable analytics, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setAnalyticsEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if analytics is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if analytics is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isAnalyticsEnabled(): Promise<any> {
return;
}
/**
* Returns the named user ID.
*
* @param {function(namedUser)} success The function to call on success.
* @param {string} success.namedUser The named user ID as a string.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
getNamedUser(): Promise<any> {
return;
}
/**
* Sets the named user ID.
*
* @param {String} namedUser identifier string.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setNamedUser(namedUser: string): Promise<any> {
return;
}
/**
* Runs an Urban Airship action.
*
* @param {String} actionName action as a string.
* @param {*} actionValue
* @param {function(result)} [success] The function to call on success.
* @param {object} success.result The result's value.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
runAction(actionName: string, actionValue: any): Promise<any> {
return;
}
/**
* Creates an editor to modify the named user tag groups.
*
* @return {TagGroupEditor} A tag group editor instance.
*/
@Cordova()
editNamedUserTagGroups(): TagGroupEditor {
return;
}
/**
* Creates an editor to modify the channel tag groups.
*
* @return {TagGroupEditor} A tag group editor instance.
*/
@Cordova()
editChannelTagGroups(): TagGroupEditor {
return;
}
/**
* Sets an associated identifier for the Connect data stream.
*
* @param key Custom key for identifier.
* @param identifier The identifier value.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setAssociatedIdentifier(key: string, identifier: string): Promise<any> {
return;
}
// Location
/**
* Enables or disables Urban Airship location services.
*
* @param {Boolean} enabled true to enable location, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setLocationEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if location is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if location is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isLocationEnabled(): Promise<any> {
return;
}
/**
* Enables or disables background location.
*
* @param {Boolean} enabled true to enable background location, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setBackgroundLocationEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if background location is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if background location updates are enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isBackgroundLocationEnabled(): Promise<any> {
return;
}
/**
* Displays the message center.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
displayMessageCenter(): Promise<any> {
return;
}
/**
* Dismiss the message center.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
dismissMessageCenter(): Promise<any> {
return;
}
/**
* Dismiss the inbox message.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
dismissInboxMessage(): Promise<any> {
return;
}
/**
* Dismiss the inbox message in the overlay.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
dismissOverlayInboxMessage(): Promise<any> {
return;
}
/**
* Gets the array of inbox messages. Each message will have the following properties:
* "id": string - The messages ID. Needed to display, mark as read, or delete the message.
* "title": string - The message title.
* "sentDate": number - The message sent date in milliseconds.
* "listIconUrl": string, optional - The icon url for the message.
* "isRead": boolean - The unread/read status of the message.
* "extras": object - String to String map of any message extras.
*
* @param {function(messages)} success The function to call on success.
* @param {array} success.messages The array of inbox messages.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
getInboxMessages(): Promise<any> {
return;
}
/**
* Marks an inbox message read.
*
* @param {String} messageId The ID of the message to mark as read.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
markInboxMessageRead(messageId: string): Promise<any> {
return;
}
/**
* Deletes an inbox message.
*
* @param {String} messageId The ID of the message to delete.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
deleteInboxMessage(messageId: string): Promise<any> {
return;
}
/**
* Displays the inbox message using a full screen view.
*
* @param {String} messageId The ID of the message to display.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
displayInboxMessage(messageId: string): Promise<any> {
return;
}
/**
* Forces the inbox to refresh. This is normally not needed as the inbox
* will automatically refresh on foreground or when a push arrives thats
* associated with a message, but it can be useful when providing a refresh
* button for the message listing.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
refreshInbox(): Promise<any> {
return;
}
/**
* Displays the inbox message using an overlay display.
*
* @param {String} messageId The ID of the message to display.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
overlayInboxMessage(messageId: string): Promise<any> {
return;
}
/**
* Clears a notification by identifier.
*
* @param {string} identifier The notification identifier.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
*/
@Cordova()
clearNotification(identifier: string): Promise<any> {
return;
}
/**
* Clears all notifications posted by the application.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
clearNotifications(): Promise<any> {
return;
}
/**
* Gets currently active notifications.
*
* Note: On Android this functionality is only supported on Android M or higher.
*
* @param {function(messages)} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
*/
@Cordova()
getActiveNotifications(): Promise<any> {
return;
}
// iOS only
/**
* Enables or disables auto badge. Defaults to `NO`.
*
* @param {Boolean} enabled true to enable auto badge, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setAutobadgeEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Sets the badge number.
*
* @param count number specified badge to set.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setBadgeNumber(count: number): Promise<any> {
return;
}
/**
* Returns the current badge number.
*
* @param {function(badgeNumber)} success The function to call on success.
* @param {int} success.badgeNumber The current application badge number.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
getBadgeNumber(): Promise<any> {
return;
}
/**
* Clears the badge.
*
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
resetBadge(): Promise<any> {
return;
}
/**
* Sets the iOS notification types. Specify the combination of
* badges, sound and alerts that are desired.
*
* @param types specified notification types.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setNotificationTypes(types: NotificationType): Promise<any> {
return;
}
/**
* Sets the iOS presentation options. Specify the combination of
* badges, sound and alerts that are desired.
*
* @param options types specified presentation options.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setPresentationOptions(options: PresentationOptions): Promise<any> {
return;
}
// Android only
/**
* Checks if notification sound is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if sound is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isSoundEnabled(): Promise<any> {
return;
}
/**
* Enables or disables notification sound.
*
* @param {Boolean} enabled true to enable sound, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setSoundEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Checks if notification vibration is enabled or not.
*
* @param {function(enabled)} success Success callback.
* @param {boolean} success.enabled Flag indicating if vibration is enabled or not.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
isVibrateEnabled(): Promise<any> {
return;
}
/**
* Enables or disables notification vibration.
*
* @param {Boolean} enabled true to enable vibration, false to disable.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
setVibrateEnabled(enabled: boolean): Promise<any> {
return;
}
/**
* Adds a custom event.
*
* @param {object} event The custom event object.
* @param {string} event.name The event's name.
* @param {number} [event.value] The event's value.
* @param {string} [event.transactionId] The event's transaction ID.
* @param {object} [event.properties] The event's properties. Only numbers, booleans, strings, and array of strings are supported.
* @param {function} [success] Success callback.
* @param {function(message)} [failure] Failure callback.
* @param {string} failure.message The error message.
*/
@Cordova()
addCustomEvent(event: object): Promise<any> {
return;
}
}
@@ -0,0 +1,605 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin, getPromise } from '@ionic-native/core';
export interface WonderPushDelegate {
urlForDeepLink(url: string, callback: (url?: string) => void): void;
}
export interface WonderPushChannel {
id: string;
groupId?: string;
name?: string;
description?: string;
bypassDnd?: boolean;
showBadge?: boolean;
importance?: number;
lights?: boolean;
lightColor?: number;
vibrate?: boolean;
sound?: boolean;
soundUri?: string;
lockscreenVisibility?: number;
vibrateInSilentMode?: boolean;
color?: number;
localOnly?: boolean;
}
export interface WonderPushChannelGroup {
id: string;
name?: string;
}
class NestedObject {
pluginObj: any;
constructor(pluginObj: any) {
this.pluginObj = pluginObj;
}
wrap<T>(functionName: string, args: any[]): Promise<T> {
const plugin = WonderPush.getPlugin();
const userPreferences = plugin ? plugin.UserPreferences : null;
if (!plugin || !userPreferences || !userPreferences[functionName]) {
return getPromise<T>((res, rej) => {
rej(new Error('Could not find plugin'));
});
}
return getPromise<T>((res, rej) => {
userPreferences[functionName].apply(userPreferences, [ ...args, res]);
});
}
}
export class UserPreferencesMethods extends NestedObject {
/**
* Get the default channel id
* @returns {Promise<string>}
*/
getDefaultChannelId(): Promise<string> {
return this.wrap<string | null>('getDefaultChannelId', []);
}
/**
* Set the default channel id
* @param {string} id
* @returns {Promise<any>}
*/
setDefaultChannelId(id: string): Promise<any> {
return this.wrap('setDefaultChannelId', [id]);
}
/**
* Get a channel group
* @param {string} groupId
* @returns {Promise<WonderPushChannelGroup | null>}
*/
getChannelGroup(groupId: string): Promise<WonderPushChannelGroup | null> {
return this.wrap<WonderPushChannelGroup | null>('getChannelGroup', [groupId]);
}
/**
* Get a channel
* @param {string} channelId
* @returns {Promise<WonderPushChannel | null>}
*/
getChannel(channelId: string): Promise<WonderPushChannel | null> {
return this.wrap<WonderPushChannel | null>('getChannel', [channelId]);
}
/**
* Create, update and remove channel existing groups to match the given channel groups
* @param {WonderPushChannelGroup[]} channelGroups
* @returns {Promise<any>}
*/
setChannelGroups(channelGroups: WonderPushChannelGroup[]): Promise<any> {
return this.wrap('setChannelGroups', [channelGroups]);
}
/**
* Create, update and remove channels to match the given channels
* @param {WonderPushChannel[]} channels
* @returns {Promise<any>}
*/
setChannels(channels: WonderPushChannel[]): Promise<any> {
return this.wrap('setChannels', [channels]);
}
/**
* Create or update a channel group
* @param {WonderPushChannelGroup} channelGroup
* @returns {Promise<any>}
*/
putChannelGroup(channelGroup: WonderPushChannelGroup): Promise<any> {
return this.wrap('putChannelGroup', [channelGroup]);
}
/**
* Create or update a channel
* @param {WonderPushChannel} channel
* @returns {Promise<any>}
*/
putChannel(channel: WonderPushChannel): Promise<any> {
return this.wrap('putChannel', [channel]);
}
/**
* Remove a channel group
* @param {string} groupId
* @returns {Promise<any>}
*/
removeChannelGroup(groupId: string): Promise<any> {
return this.wrap('removeChannelGroup', [groupId]);
}
/**
* Remove a channel
* @param {string} channelId
* @returns {Promise<any>}
*/
removeChannel(channelId: string): Promise<any> {
return this.wrap('removeChannel', [channelId]);
}
}
/**
* @name WonderPush
* @description
*
* Push notification delivery with the WonderPush service.
*
* Get started in minutes: [Ionic Quickstart Guide](https://docs.wonderpush.com/docs/ionic-quickstart).
*
* Requires the Cordova plugin `wonderpush-cordova-sdk`.
*
* [WonderPush](https://www.wonderpush.com) is the most effective way
* to retain your users and grow your audience while remaining fully GDPR compliant.
*
* @usage
* ```typescript
* import { WonderPush } from '@ionic-native/wonderpush';
*
*
* constructor(private wonderPush: WonderPush) { }
*
* ...
*
* // Subscribe user
* this.wonderPush.subscribeToNotifications()
* .then(() => console.log("User subscribed to notifications"))
* .catch((error: any) => console.error(error));
*
*
* // Send an event (a purchase in this example)
* this.wonderPush.sendEvent('purchase', {
* float_price: 12.99,
* string_sku: "X123456"
* });
*
* // Tag users (as customers)
* this.wonderPush.addTag('customer');
*
* // Personalize
* 1. Store user details.
* 2. Use those details to create segments.
* 3. Include those details in your notifications.
* this.wonderPush.putProperties({
* string_name: 'John D.',
* int_age: 24
* });
*
* // GDPR
* 1. set REQUIRES_USER_CONSENT=true to enable GDPR compliance.
* 2. WonderPush doesn't start until setUserConsent(true) is called.
* const onClick = (userConsent: boolean) => this.wonderPush.setUserConsent(userConsent);
* ```
*
* // Listen to notification clicks
* document.addEventListener('wonderpush.notificationOpen', function(event) {
* console.log('Notification opened', event.notification);
* if (event.notificationType === 'data') {
* console.log('Silent notification', event.notification);
* }
* });
*
* @interfaces
* WonderPushChannel
* WonderPushChannelGroup
*/
@Plugin({
pluginName: 'WonderPush',
plugin: 'wonderpush-cordova-sdk',
pluginRef: 'WonderPush',
repo: 'https://github.com/wonderpush/wonderpush-cordova-sdk',
install: 'ionic cordova plugin add wonderpush-cordova-sdk --variable CLIENT_ID=YOUR_CLIENT_ID --variable CLIENT_SECRET=YOUR_CLIENT_SECRET ',
installVariables: ['CLIENT_ID', 'CLIENT_SECRET'],
platforms: ['Android', 'iOS'],
})
@Injectable()
export class WonderPush extends IonicNativePlugin {
/**
* Sets the user id, used to identify a single identity across multiple devices,
* and to correctly identify multiple users on a single device.
*
* If not called, the last used user id it assumed. Defaulting to `null` if none is known.
*
* Upon changing userId, the access token is wiped, so avoid unnecessary calls, like calling with `null`
* just before calling with a user id.
*
* @param {?string} userId - The user id, unique to your application.
* Use `null` for anonymous users.
*
* You are strongly encouraged to use your own unique internal identifier.
* @returns {Promise<any>}
*/
@Cordova()
setUserId(userId: string | null): Promise<any> {
return;
}
/**
* Whether the SDK is ready to operate.
*
* The SDK is ready when it is initialized and has fetched an access token.
* @returns {Promise<any>}
*/
@Cordova()
isReady(): Promise<boolean> {
return;
}
/**
* Controls native SDK logging.
* @param {boolean} enabled - Whether to enable logs.
* @returns {Promise<any>}
*/
@Cordova()
setLogging(enabled: boolean): Promise<any> {
return;
}
/**
* Sets up a delegate for tighter integration, or removes it.
* @param {?WonderPushDelegate} delegate - The delegate to set, or `null` to remove it.
* @returns {Promise<any>}
*/
@Cordova()
setDelegate(delegate: WonderPushDelegate | null): Promise<any> {
return;
}
/**
* Gets the current delegate.
* @returns {Promise<WonderPushDelegate | null>} A promise with the delegate of null
*/
@Cordova()
getDelegate(): Promise<WonderPushDelegate | null> {
return;
}
/**
* Returns the userId currently in use, `null` by default.
* @returns {Promise<string | null>} A promise with the user ID or null
*/
@Cordova()
getUserId(): Promise<string | null > {
return;
}
/**
* Returns the installationId identifying your application on a device, bond to a specific userId.
* If you want to store this information on your servers, keep the corresponding userId with it.
* Will return `null` until the SDK is properly initialized.
* @returns {Promise<string | null>} A promise with the installation ID or null
*/
@Cordova()
getInstallationId(): Promise<string | null> {
return;
}
/**
* Returns the unique device identifier
* @returns {Promise<string | null>} A promise with the device ID or null
*/
@Cordova()
getDeviceId(): Promise<string | null> {
return;
}
/**
* Returns the push token.
* @returns {Promise<string | null>} A promise with the push token or `null`
*/
@Cordova()
getPushToken(): Promise<string | null> {
return;
}
/**
* Returns the currently used access token.
* Returns `null` until the SDK is properly initialized.
* This together with your client secret gives entire control to the current installation and associated user, you should not disclose it unnecessarily.
* @returns {Promise<string | null>}
*/
@Cordova()
getAccessToken(): Promise<string | null> {
return;
}
/**
* Send an event to be tracked to WonderPush.
*
* @param {string} type - The event type, or name. Event types starting with an `@` character are reserved.
* @param {?object} [attributes] - An object containing custom properties to be attached to the event.
* The keys should be prefixed according to the type of their values.
* You can find the details in the [Concepts > Custom fields](https://www.wonderpush.com/docs/guide/custom-fields) section of the documentation.
* @returns {Promise<any>}
*/
@Cordova()
trackEvent(type: string, attributes: { [key: string]: any }): Promise<any> {
return;
}
/**
* Adds one or more tags to the installation.
* @param {string|string[]} tag - The tags to add to the installation. You can use either a single string argument or an array of strings.
* @returns {Promise<any>}
*/
@Cordova()
addTag(tag: string | string[]): Promise<any> {
return;
}
/**
* Removes one or more tags from the installation.
* @param {string|string[]} tag - The tags to remove from the installation. You can use either a single string argument or an array of strings.
* @returns {Promise<any>}
*/
@Cordova()
removeTag(tag: string | string[]): Promise<any> {
return;
}
/**
* Removes all tags from the installation.
* @returns {Promise<any>}
*/
@Cordova()
removeAllTags(): Promise<any> {
return;
}
/**
* Returns all the tags of the installation.
* @returns {Promise<string[]>}
*/
@Cordova()
getTags(): Promise<string[]> {
return;
}
/**
* Tests whether the installation has the given tag attached to it.
* @param {string} tag - The tag to test.
* @returns {Promise<boolean>}
*/
@Cordova()
hasTag(tag: string): Promise<boolean> {
return;
}
/**
* Sets the value to a given installation property.
*
* The previous value is replaced entirely.
* Setting `undefined` or `null` has the same effect as {@link cordova.plugins.WonderPush#unsetProperty}.
*
* @param {string} field - The name of the property to set
* @param value
* @returns {Promise<any>}
*/
@Cordova()
setProperty(field: string, value: any): Promise<any> {
return;
}
/**
* Removes the value of a given installation property.
*
* The previous value is replaced with `null`.
*
* @param {string} field - The name of the property
* @returns {Promise<any>}
*/
@Cordova()
unsetProperty(field: string): Promise<any> {
return;
}
/**
* Adds the value to a given installation property.
*
* The stored value is made an array if not already one.
* If the given value is an array, all its values are added.
* If a value is already present in the stored value, it won't be added.
*
* @param {string} field - The name of the property
* @param value
* @returns {Promise<void>}
*/
@Cordova()
addProperty(field: string, value: any): Promise<void> {
return;
}
/**
* Removes the value from a given installation property.
*
* The stored value is made an array if not already one.
* If the given value is an array, all its values are removed.
* If a value is present multiple times in the stored value, they will all be removed.
*
* @param {string} field - The name of the property
* @param value
* @returns {Promise<any>}
*/
@Cordova()
removeProperty(field: string, value: any): Promise<any> {
return;
}
/**
* Returns the value of a given installation property.
*
* If the property stores an array, only the first value is returned.
* This way you don't have to deal with potential arrays if that property is not supposed to hold one.
* Returns `null` if the property is absent or has an empty array value.
*
* @param {string} field - The name of the property to read values from
* @returns {Promise<any>}
*/
@Cordova()
getPropertyValue(field: string): Promise<any> {
return;
}
/**
* Returns an array of the values of a given installation property.
*
* If the property does not store an array, an array is returned nevertheless.
* This way you don't have to deal with potential scalar values if that property is supposed to hold an array.
* Returns an empty array instead of `null` if the property is absent.
* Returns an array wrapping any scalar value held by the property.
*
* @param {string} field - The name of the property to read values from
* @returns {Promise<any[]>}
*/
@Cordova()
getPropertyValues(field: string): Promise<any[]> {
return;
}
/**
* Returns the latest known custom properties attached to the current installation object stored by WonderPush.
* @returns {Promise<{[p: string]: any}>}
*/
@Cordova()
getProperties(): Promise<{[key: string]: any}> {
return;
}
/**
* Updates the properties attached to the current installation object stored by WonderPush.
*
* In order to remove a value, use `null`.
*
* @param {{[p: string]: any}} properties. The keys should be prefixed according to the type of their values. You can find the details in the [Segmentation > Properties](https://docs.wonderpush.com/docs/properties#section-custom-properties) section of the documentation.
* @returns {Promise<any>}
*/
@Cordova()
putProperties(properties: {[key: string]: any}): Promise<any> {
return;
}
/**
* Subscribes to push notification and registers the device token with WondePush.
*
* On iOS, you **must** call the following method at least once to make the notification visible to the user.
*
* - You can call this method multiple times. The user is only prompted for permission by iOS once.
* - There is no need to call this method if the permission has already been granted, but it does not harm either.
* - If the permission has been denied in the OS, the user will stay soft opt-out.
*
* Because in iOS you only have *one* chance for prompting the user, you should find a good timing for that.
* For a start, you can systematically call it when the application starts, so that the user will be prompted directly at the first launch.
*
* @return {Promise<any>} Returns a promise that resolves upon successful subscription
*/
@Cordova()
subscribeToNotifications(): Promise<any> {
return;
}
/**
* Returns whether the notifications are enabled.
* @returns {Promise<boolean>}
*/
@Cordova()
isSubscribedToNotifications(): Promise<boolean> {
return;
}
/**
* Unsubscribes from push notification.
* This method marks the user as soft opt-out.
*
* @returns {Promise<any>}
*/
@Cordova()
unsubscribeFromNotifications(): Promise<any> {
return;
}
/**
* Reads user consent state.
* Returns undefined if no explicit consent was set.
* @returns {Promise<boolean>}
*/
@Cordova()
getUserConsent(): Promise<boolean> {
return;
}
/**
* Provides or withdraws user consent.
* If the `requiresUserConsent` initialization option is true,
* the whole SDK is paused and no data is sent to WonderPush, until consent is provided.
* @param {boolean} consent -
* @returns {Promise<any>}
*/
@Cordova()
setUserConsent(consent: boolean): Promise<any> {
return;
}
/**
* Remove any local storage and ask the WonderPush servers to delete any data associated with the all local installations and related users.
* @returns {Promise<any>}
*/
@Cordova()
clearAllData(): Promise<any> {
return;
}
/**
* Ask the WonderPush servers to delete any event associated with the all local installations.
* @returns {Promise<any>}
*/
@Cordova()
clearEventsHistory(): Promise<any> {
return;
}
/**
* Ask the WonderPush servers to delete any custom data associated with the all local installations and related users.
*
* @returns {Promise<any>}
*/
@Cordova()
clearPreferences(): Promise<any> {
return;
}
/**
* Initiates the download of all user remote and local data.
*
* @returns {Promise<any>}
*/
@Cordova()
downloadAllData(): Promise<any> {
return;
}
UserPreferences = new UserPreferencesMethods(this);
}