Compare commits

...

20 Commits
v5 ... v4.11.0

Author SHA1 Message Date
Daniel
4f26069ca6 chore(): update changelog 2018-07-29 10:05:10 +02:00
Daniel
40571e5c99 4.11.0 2018-07-29 10:04:57 +02:00
Daniel
83194f616b Revert "chore(package): upgrade fs-extra"
This reverts commit 4297c3d43e.
2018-07-29 09:59:53 +02:00
Daniel
b1f4df530a rerun build 2018-07-29 09:57:03 +02:00
Daniel
4297c3d43e chore(package): upgrade fs-extra 2018-07-29 09:52:36 +02:00
Daniel
95d495b468 chore(package): bump deps 2018-07-29 09:44:22 +02:00
Daniel
f0989d1b96 chore(package): upgrade to angular 5
BREAKING: Ionic Native v4 requires now Angular 5
2018-07-29 09:21:43 +02:00
Daniel
c113417878 docs(readme): update readme 2018-07-29 09:20:23 +02:00
Daniel
cedd6df423 Merge remote-tracking branch 'origin/master' 2018-07-29 09:16:11 +02:00
Daniel
4b14ce2eec refactor(http): change return type to any 2018-07-29 09:16:00 +02:00
pwilkniss
27d380ef4b feat(clevertap): add CleverTap plugin (#2609)
* feat(clevertap): add CleverTap plugin

* style(clevertap): cleanup stray lint error

* refactor
2018-07-29 09:13:37 +02:00
Ashwin Dinesh
bd5bd7ea9d feat(webengage): add webengage plugin (#2604)
* feat(webengage): add webengage plugin

* refactor
2018-07-29 09:11:05 +02:00
Jan Piotrowski
c6713862c5 refactor: Improve Ionic Native warnings (#2611)
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
2018-07-29 09:10:48 +02:00
Daniel
3b32e19bf1 feat(facebook): add getDeferredApplink function
closes: #2510
2018-07-29 09:10:17 +02:00
Daniel
4092831754 fix(http): add correct return types for downloadFile and uploadFile
closes: #2615
2018-07-29 08:57:16 +02:00
Daniel Sogl
c2fe5f8336 docs(contacts): mark as deprecated 2018-07-27 21:39:58 +02:00
Daniel
3f9067d090 chore(): update changelog 2018-07-25 12:57:52 +02:00
Daniel
36a4e81fe4 4.10.1 2018-07-25 12:57:38 +02:00
Gustavo Maximiliano Cortez
79cb478c26 fix(user-agent): Plugin not installed (#2607)
fix(user-agent): Plugin not installed
2018-07-24 16:59:19 +02:00
Dominik Geng
b635ba99ea fix(nfs): Optional arguments for records like textRecord (#2605)
fix(nfs): Optional arguments for records like textRecord
2018-07-24 16:59:02 +02:00
13 changed files with 5151 additions and 626 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ node_modules/
aot/
scripts/ionic-native-bower
dist/

View File

@@ -1,12 +1,40 @@
<a name="4.10.0"></a>
# [4.10.0](https://github.com/ionic-team/ionic-native/compare/v4.9.2...v4.10.0) (2018-07-18)
<a name="4.11.0"></a>
# [4.11.0](https://github.com/ionic-team/ionic-native/compare/v4.10.1...v4.11.0) (2018-07-29)
### Bug Fixes
* **http:** add correct return types for downloadFile and uploadFile ([4092831](https://github.com/ionic-team/ionic-native/commit/4092831)), closes [#2615](https://github.com/ionic-team/ionic-native/issues/2615)
### Features
* **clevertap:** add CleverTap plugin ([#2609](https://github.com/ionic-team/ionic-native/issues/2609)) ([27d380e](https://github.com/ionic-team/ionic-native/commit/27d380e))
* **facebook:** add getDeferredApplink function ([3b32e19](https://github.com/ionic-team/ionic-native/commit/3b32e19)), closes [#2510](https://github.com/ionic-team/ionic-native/issues/2510)
* **webengage:** add webengage plugin ([#2604](https://github.com/ionic-team/ionic-native/issues/2604)) ([bd5bd7e](https://github.com/ionic-team/ionic-native/commit/bd5bd7e))
<a name="4.10.1"></a>
## [4.10.1](https://github.com/ionic-team/ionic-native/compare/v5.0.0-beta.14...v4.10.1) (2018-07-25)
### Bug Fixes
* **nfs:** Optional arguments for records like textRecord ([#2605](https://github.com/ionic-team/ionic-native/issues/2605)) ([b635ba9](https://github.com/ionic-team/ionic-native/commit/b635ba9))
* **user-agent:** Plugin not installed ([#2607](https://github.com/ionic-team/ionic-native/issues/2607)) ([79cb478](https://github.com/ionic-team/ionic-native/commit/79cb478))
<a name="5.0.0-beta.14"></a>
# [5.0.0-beta.14](https://github.com/ionic-team/ionic-native/compare/v4.10.0...v5.0.0-beta.14) (2018-07-18)
### Features
* **abbyy-rtr:** add ABBYY Real-Time Recognition plugin ([#2580](https://github.com/ionic-team/ionic-native/issues/2580)) ([ecc698e](https://github.com/ionic-team/ionic-native/commit/ecc698e))
* **alipay:** replace plugin ([#2591](https://github.com/ionic-team/ionic-native/issues/2591)) ([e640983](https://github.com/ionic-team/ionic-native/commit/e640983))
* **fcm:** replace plugin source ([#2601](https://github.com/ionic-team/ionic-native/issues/2601)) ([b581a5b](https://github.com/ionic-team/ionic-native/commit/b581a5b))
* **ccm:** replace plugin source ([#2601](https://github.com/ionic-team/ionic-native/issues/2601)) ([b581a5b](https://github.com/ionic-team/ionic-native/commit/b581a5b))
* **classkit:** add ClassKit plugin ([#2590](https://github.com/ionic-team/ionic-native/issues/2590)) ([a6c8045](https://github.com/ionic-team/ionic-native/commit/a6c8045))

View File

@@ -1,6 +1,5 @@
[![Circle CI](https://circleci.com/gh/ionic-team/ionic-native.svg?style=shield)](https://circleci.com/gh/ionic-team/ionic-native) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) ![](https://img.shields.io/npm/v/@ionic-native/core.svg)
# Ionic Native
Ionic Native is a curated set of wrappers for Cordova plugins that make adding any native functionality you need to your [Ionic](https://ionicframework.com/) mobile app easy.
@@ -10,8 +9,9 @@ Ionic Native wraps plugin callbacks in a Promise or Observable, providing a comm
## Installation
Run following command to install Ionic Native in your project.
```bash
npm install @ionic-native/core --save
npm install @ionic-native/core
```
You also need to install the Ionic Native package for each plugin you want to add. Please see the [Ionic Native documentation](https://ionicframework.com/docs/native/) for complete instructions on how to add and use the plugins.
@@ -68,9 +68,9 @@ export class MyComponent {
// to stop watching
watch.unsubscribe();
});
}
}
```
@@ -92,8 +92,8 @@ Then create a new class that extends the `Camera` class with a mock implementati
class CameraMock extends Camera {
getPicture(options) {
return new Promise((resolve, reject) => {
resolve("BASE_64_ENCODED_DATA_GOES_HERE");
})
resolve('BASE_64_ENCODED_DATA_GOES_HERE');
});
}
}
```
@@ -101,9 +101,7 @@ class CameraMock extends Camera {
Finally, override the previous `Camera` class in your `providers` for this module:
```typescript
providers: [
{ provide: Camera, useClass: CameraMock }
]
providers: [{ provide: Camera, useClass: CameraMock }];
```
Here's the full example:
@@ -126,37 +124,26 @@ class CameraMock extends Camera {
}
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
declarations: [MyApp, HomePage],
imports: [BrowserModule, IonicModule.forRoot(MyApp)],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
entryComponents: [MyApp, HomePage],
providers: [
{ provide: ErrorHandler, useClass: IonicErrorHandler },
{ provide: Camera, useClass: CameraMock }
]
})
export class AppModule {}
```
### Runtime Diagnostics
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
![img](https://ionic-io-assets.s3.amazonaws.com/ionic-native-console.png)
## Plugin Missing?
Let us know or submit a PR! Take a look at [the Developer Guide](https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md) for more on how to contribute. :heart:
## Ionic v1 (AngularJS, Angular 1.x) support

4734
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,45 +1,44 @@
{
"name": "ionic-native",
"version": "4.10.0",
"version": "4.11.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)",
"license": "MIT",
"devDependencies": {
"@angular/compiler": "4.4.4",
"@angular/compiler-cli": "4.4.4",
"@angular/core": "4.4.4",
"@angular/compiler": "^5.2.11",
"@angular/compiler-cli": "^5.2.11",
"@angular/core": "^5.2.11",
"@types/cordova": "0.0.34",
"@types/jasmine": "^2.8.8",
"@types/node": "^8.10.20",
"@types/node": "8.10.20",
"canonical-path": "0.0.2",
"child-process-promise": "2.2.1",
"conventional-changelog-cli": "1.3.4",
"cpr": "2.0.0",
"cz-conventional-changelog": "2.0.0",
"conventional-changelog-cli": "^2.0.1",
"cz-conventional-changelog": "^2.1.0",
"dgeni": "0.4.7",
"dgeni-packages": "0.16.10",
"fs-extra": "2.0.0",
"fs-extra-promise": "0.4.1",
"gulp": "3.9.1",
"gulp-rename": "1.2.2",
"gulp-replace": "0.5.4",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"gulp-tslint": "6.1.2",
"jasmine-core": "^2.99.1",
"karma": "^1.7.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.5",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.2",
"karma-phantomjs-launcher": "^1.0.4",
"karma-typescript": "^3.0.12",
"karma-typescript": "^3.0.13",
"karma-typescript-es6-transform": "^1.0.4",
"lodash": "4.17.4",
"lodash": "^4.17.10",
"minimist": "1.2.0",
"node-html-encoder": "0.0.2",
"q": "1.5.0",
"queue": "4.2.1",
"rimraf": "2.6.1",
"q": "^1.5.1",
"queue": "^4.4.2",
"rimraf": "^2.6.2",
"rxjs": "^5.5.11",
"semver": "5.3.0",
"semver": "^5.5.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "~2.4.2",

View File

@@ -53,7 +53,7 @@ export const pluginWarn = (
): void => {
if (method) {
console.warn(
'Native: tried calling ' +
'Ionic Native: tried calling ' +
pluginName +
'.' +
method +
@@ -63,12 +63,12 @@ export const pluginWarn = (
);
} else {
console.warn(
`'Native: tried accessing the ${pluginName} plugin but it's not installed.`
`'Ionic Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
}
if (plugin) {
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
}
};
@@ -81,17 +81,17 @@ export const pluginWarn = (
export const cordovaWarn = (pluginName: string, method?: string): void => {
if (method) {
console.warn(
'Native: tried calling ' +
'Ionic Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
', but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
' plugin but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
);
}
};

View File

@@ -0,0 +1,592 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
declare var clevertap: any;
/**
* @name CleverTap
* @description
* Cordova Plugin that wraps CleverTap SDK for Android and iOS
*
* @usage
* ```typescript
* import { CleverTap } from '@ionic-native/clevertap';
* constructor(private clevertap: CleverTap) { }
*
* ```
*/
@Plugin({
pluginName: 'CleverTap',
plugin: 'clevertap-cordova',
pluginRef: 'CleverTap',
repo: 'https://github.com/CleverTap/clevertap-cordova',
platforms: ['Android', 'iOS']
})
@Injectable()
export class CleverTap extends IonicNativePlugin {
/**
* notify device ready
* NOTE: in iOS use to be notified of launch Push Notification or Deep Link
* in Android use only in android phonegap build projects
* @returns {Promise<any>}
*/
@Cordova()
notifyDeviceReady(): Promise<any> {
return;
}
/*******************
* Personalization
******************/
/**
* Personalization
* Enables the Personalization API
* @returns {Promise<any>}
*/
@Cordova()
enablePersonalization(): Promise<any> {
return;
}
/**
* Enables tracking opt out for the currently active user.
* @param optOut {boolean}
* @returns {Promise<any>}
*/
@Cordova()
setOptOut(optOut: boolean): Promise<any> {
return;
}
/**
* Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
* @param enable {boolean}
* @returns {Promise<any>}
*/
@Cordova()
enableDeviceNetworkInfoReporting(enable: boolean): Promise<any> {
return;
}
/*******************
* Push
******************/
/**
* Registers for push notifications
* @returns {Promise<any>}
*/
@Cordova()
registerPush(): Promise<any> {
return;
}
/**
* Sets the device's push token
* @param token {string}
* @returns {Promise<any>}
*/
@Cordova()
setPushToken(token: string): Promise<any> {
return;
}
/**
* Create Notification Channel for Android O+
* @param channelID {string}
* @param channelName {string}
* @param channelDescription {string}
* @param importance {number}
* @param showBadge {boolean}
* @returns {Promise<any>}
*/
@Cordova()
createNotificationChannel(
channelID: string,
channelName: string,
channelDescription: string,
importance: number,
showBadge: boolean
): Promise<any> {
return;
}
/**
* Create Notification Channel for Android O+
* @param channelID {string}
* @param channelName {string}
* @param channelDescription {string}
* @param importance {number}
* @param showBadge {boolean}
* @param sound {string}
* @returns {Promise<any>}
*/
@Cordova()
createNotificationChannelWithSound(
channelID: string,
channelName: string,
channelDescription: string,
importance: number,
showBadge: boolean,
sound: string
): Promise<any> {
return;
}
/**
* Create Notification Channel with Group ID for Android O+
* @param channelID {string}
* @param channelName {string}
* @param channelDescription {string}
* @param importance {number}
* @param groupId {string}
* @param showBadge {boolean}
* @param sound {string}
* @returns {Promise<any>}
*/
@Cordova()
createNotificationChannelWithGroupId(
channelID: string,
channelName: string,
channelDescription: string,
importance: number,
groupId: string,
showBadge: boolean
): Promise<any> {
return;
}
/**
* Create Notification Channel with Group ID for Android O+
* @param channelID {string}
* @param channelName {string}
* @param channelDescription {string}
* @param importance {number}
* @param groupId {string}
* @param showBadge {boolean}
* @returns {Promise<any>}
*/
@Cordova()
createNotificationChannelWithGroupIdAndSound(
channelID: string,
channelName: string,
channelDescription: string,
importance: number,
groupId: string,
showBadge: boolean,
sound: string
): Promise<any> {
return;
}
/**
* Create Notification Channel Group for Android O+
* @param groupID {string}
* @param groupName {string}
* @returns {Promise<any>}
*/
@Cordova()
createNotificationChannelGroup(
groupID: string,
groupName: string
): Promise<any> {
return;
}
/**
* Delete Notification Channel for Android O+
* @param channelID {string}
* @returns {Promise<any>}
*/
@Cordova()
deleteNotificationChannel(channelID: string): Promise<any> {
return;
}
/**
* Delete Notification Group for Android O+
* @param groupID {string}
* @returns {Promise<any>}
*/
@Cordova()
deleteNotificationChannelGroup(groupID: string): Promise<any> {
return;
}
/*******************
* Events
******************/
/**
* Record Screen View
* @param screenName {string}
* @returns {Promise<any>}
*/
@Cordova()
recordScreenView(screenName: string): Promise<any> {
return;
}
/**
* Record Event with Name
* @param eventName {string}
* @returns {Promise<any>}
*/
@Cordova()
recordEventWithName(eventName: string): Promise<any> {
return;
}
/**
* Record Event with Name and Event properties
* @param eventName {string}
* @param eventProps {any}
* @returns {Promise<any>}
*/
@Cordova()
recordEventWithNameAndProps(
eventName: string,
eventProps: any
): Promise<any> {
return;
}
/**
* Record Charged Event with Details and Items
* @param details {any} object with transaction details
* @param items {any} array of items purchased
* @returns {Promise<any>}
*/
@Cordova()
recordChargedEventWithDetailsAndItems(
details: any,
items: any
): Promise<any> {
return;
}
/**
* Get Event First Time
* @param eventName {string}
* callback returns epoch seconds or -1
* @returns {Promise<any>}
*/
@Cordova()
eventGetFirstTime(eventName: string): Promise<any> {
return;
}
/**
* Get Event Last Time
* @param eventName {string}
* callback returns epoch seconds or -1
* @returns {Promise<any>}
*/
@Cordova()
eventGetLastTime(eventName: string): Promise<any> {
return;
}
/**
* Get Event Number of Occurrences
* @param eventName {string}
* calls back with int or -1
* @returns {Promise<any>}
*/
@Cordova()
eventGetOccurrences(eventName: string): Promise<any> {
return;
}
/**
* Get Event Details
* @param eventName {string}
* calls back with object {"eventName": <string>, "firstTime":<epoch seconds>, "lastTime": <epoch seconds>, "count": <int>} or empty object
* @returns {Promise<any>}
*/
@Cordova()
eventGetDetails(eventName: string): Promise<any> {
return;
}
/**
* Get Event History
* calls back with object {"eventName1":<event1 details object>, "eventName2":<event2 details object>}
* @returns {Promise<any>}
*/
@Cordova()
getEventHistory(): Promise<any> {
return;
}
/*******************
* Profiles
******************/
/**
* Get the device location if available.
* On iOS:
* Calling this will prompt the user location permissions dialog.
* Please be sure to include the NSLocationWhenInUseUsageDescription key in your Info.plist.
* Uses desired accuracy of kCLLocationAccuracyHundredMeters.
* If you need background location updates or finer accuracy please implement your own location handling.
* On Android:
* Requires Location Permission in AndroidManifest e.g. "android.permission.ACCESS_COARSE_LOCATION"
* You can use location to pass it to CleverTap via the setLocation API
* for, among other things, more fine-grained geo-targeting and segmentation purposes.
* Note: on iOS the call to CleverTapSDK must be made on the main thread due to LocationManager restrictions, but the CleverTapSDK method itself is non-blocking.
* calls back with {lat:lat, lon:lon} lat and lon are floats
* @returns {Promise<any>}
*/
@Cordova()
getLocation(): Promise<any> {
return;
}
/**
* Set location
* @param lat {number}
* @param lon {number}
* @returns {Promise<any>}
*/
@Cordova()
setLocation(lat: number, lon: number): Promise<any> {
return;
}
/**
* Creates a separate and distinct user profile identified by one or more of Identity, Email, FBID or GPID values,
* and populated with the key-values included in the profile dictionary.
* If your app is used by multiple users, you can use this method to assign them each a unique profile to track them separately.
* If instead you wish to assign multiple Identity, Email, FBID and/or GPID values to the same user profile,
* use profileSet rather than this method.
* If none of Identity, Email, FBID or GPID is included in the profile dictionary,
* all properties values will be associated with the current user profile.
* When initially installed on this device, your app is assigned an "anonymous" profile.
* The first time you identify a user on this device (whether via onUserLogin or profileSet),
* the "anonymous" history on the device will be associated with the newly identified user.
* Then, use this method to switch between subsequent separate identified users.
* Please note that switching from one identified user to another is a costly operation
* in that the current session for the previous user is automatically closed
* and data relating to the old user removed, and a new session is started
* for the new user and data for that user refreshed via a network call to CleverTap.
* In addition, any global frequency caps are reset as part of the switch.
* @param profile {any} object
* @returns {Promise<any>}
*/
@Cordova()
onUserLogin(profile: any): Promise<any> {
return;
}
/**
* Set profile attributes
* @param profile {any} object
* @returns {Promise<any>}
*/
@Cordova()
profileSet(profile: any): Promise<any> {
return;
}
/**
* Set profile attributes from facebook user
* @param profile {any} facebook graph user object
* @returns {Promise<any>}
*/
@Cordova()
profileSetGraphUser(profile: any): Promise<any> {
return;
}
/**
* Set profile attributes rom google plus user
* @param profile {any} google plus user object
* @returns {Promise<any>}
*/
@Cordova()
profileGooglePlusUser(profile: any): Promise<any> {
return;
}
/**
* Get User Profile Property
* @param propertyName {string}
* calls back with value of propertyName or false
* @returns {Promise<any>}
*/
@Cordova()
profileGetProperty(propertyName: string): Promise<any> {
return;
}
/**
* Get a unique CleverTap identifier suitable for use with install attribution providers.
* calls back with unique CleverTap attribution identifier
* @returns {Promise<any>}
*/
@Cordova()
profileGetCleverTapAttributionIdentifier(): Promise<any> {
return;
}
/**
* Get User Profile CleverTapID
* calls back with CleverTapID or false
* @returns {Promise<any>}
*/
@Cordova()
profileGetCleverTapID(): Promise<any> {
return;
}
/**
* Remove the property specified by key from the user profile
* @param key {string}
* @returns {Promise<any>}
*/
@Cordova()
profileRemoveValueForKey(key: string): Promise<any> {
return;
}
/**
* Method for setting a multi-value user profile property
* @param key {string}
* @param values {any} array of strings
* @returns {Promise<any>}
*/
@Cordova()
profileSetMultiValues(key: string, values: any): Promise<any> {
return;
}
/**
* Method for adding a value to a multi-value user profile property
* @param key {string}
* @param value {string}
* @returns {Promise<any>}
*/
@Cordova()
profileAddMultiValue(key: string, value: string): Promise<any> {
return;
}
/**
* Method for adding values to a multi-value user profile property
* @param key {string}
* @param values {any} array of strings
* @returns {Promise<any>}
*/
@Cordova()
profileAddMultiValues(key: string, values: any): Promise<any> {
return;
}
/**
* Method for removing a value from a multi-value user profile property
* @param key {string}
* @param value {string}
* @returns {Promise<any>}
*/
@Cordova()
profileRemoveMultiValue(key: string, value: string): Promise<any> {
return;
}
/**
* Method for removing a value from a multi-value user profile property
* @param key {string}
* @param values {any} array of strings
* @returns {Promise<any>}
*/
@Cordova()
profileRemoveMultiValues(key: string, values: any): Promise<any> {
return;
}
/*******************
* Session
******************/
/**
* Get Session Elapsed Time
* calls back with seconds
* @returns {Promise<any>}
*/
@Cordova()
sessionGetTimeElapsed(): Promise<any> {
return;
}
/**
* Get Session Total Visits
* calls back with with int or -1
* @returns {Promise<any>}
*/
@Cordova()
sessionGetTotalVisits(): Promise<any> {
return;
}
/**
* Get Session Screen Count
* calls back with with int
* @returns {Promise<any>}
*/
@Cordova()
sessionGetScreenCount(): Promise<any> {
return;
}
/**
* Get Session Previous Visit Time
* calls back with with epoch seconds or -1
* @returns {Promise<any>}
*/
@Cordova()
sessionGetPreviousVisitTime(): Promise<any> {
return;
}
/**
* Get Sesssion Referrer UTM details
* object {"source": <string>, "medium": <string>, "campaign": <string>} or empty object
* @returns {Promise<any>}
*/
@Cordova()
sessionGetUTMDetails(): Promise<any> {
return;
}
/**
* Call this to manually track the utm details for an incoming install referrer
* @param source {string}
* @param medium {string}
* @param campaign {string}
* @returns {Promise<any>}
*/
@Cordova()
pushInstallReferrer(
source: string,
medium: string,
campaign: string
): Promise<any> {
return;
}
/*******************
* Developer Options
******************/
/**
* 0 is off, 1 is info, 2 is debug, default is 1
* @param level {number}
* @returns {Promise<any>}
*/
@Cordova()
setDebugLevel(level: number): Promise<any> {
return;
}
}

View File

@@ -306,6 +306,7 @@ export class ContactFindOptions implements IContactFindOptions {
* @description
* Access and manage Contacts on the device.
*
* @deprecated
* @usage
*
* ```typescript

View File

@@ -2,11 +2,9 @@ import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface FacebookLoginResponse {
status: string;
authResponse: {
session_key: boolean;
accessToken: string;
@@ -18,9 +16,7 @@ export interface FacebookLoginResponse {
secret: string;
userID: string;
};
}
/**
@@ -114,46 +110,46 @@ export interface FacebookLoginResponse {
plugin: 'cordova-plugin-facebook4',
pluginRef: 'facebookConnectPlugin',
repo: 'https://github.com/jeduan/cordova-plugin-facebook4',
install: 'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
install:
'ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"',
installVariables: ['APP_ID', 'APP_NAME'],
platforms: ['Android', 'iOS', 'Browser']
})
@Injectable()
export class Facebook extends IonicNativePlugin {
EVENTS: {
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app',
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app',
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions',
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions',
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration',
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view',
EVENT_NAME_SEARCHED: 'fb_mobile_search',
EVENT_NAME_RATED: 'fb_mobile_rate',
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion',
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token',
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart',
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist',
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout',
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info',
EVENT_NAME_PURCHASED: 'fb_mobile_purchase',
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved',
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked',
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits',
EVENT_PARAM_CURRENCY: 'fb_currency',
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method',
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type',
EVENT_PARAM_CONTENT_ID: 'fb_content_id',
EVENT_PARAM_SEARCH_STRING: 'fb_search_string',
EVENT_PARAM_SUCCESS: 'fb_success',
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value',
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available',
EVENT_PARAM_NUM_ITEMS: 'fb_num_items',
EVENT_PARAM_LEVEL: 'fb_level',
EVENT_PARAM_DESCRIPTION: 'fb_description',
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source',
EVENT_PARAM_VALUE_YES: '1',
EVENT_PARAM_VALUE_NO: '0'
EVENT_NAME_ACTIVATED_APP: 'fb_mobile_activate_app';
EVENT_NAME_DEACTIVATED_APP: 'fb_mobile_deactivate_app';
EVENT_NAME_SESSION_INTERRUPTIONS: 'fb_mobile_app_interruptions';
EVENT_NAME_TIME_BETWEEN_SESSIONS: 'fb_mobile_time_between_sessions';
EVENT_NAME_COMPLETED_REGISTRATION: 'fb_mobile_complete_registration';
EVENT_NAME_VIEWED_CONTENT: 'fb_mobile_content_view';
EVENT_NAME_SEARCHED: 'fb_mobile_search';
EVENT_NAME_RATED: 'fb_mobile_rate';
EVENT_NAME_COMPLETED_TUTORIAL: 'fb_mobile_tutorial_completion';
EVENT_NAME_PUSH_TOKEN_OBTAINED: 'fb_mobile_obtain_push_token';
EVENT_NAME_ADDED_TO_CART: 'fb_mobile_add_to_cart';
EVENT_NAME_ADDED_TO_WISHLIST: 'fb_mobile_add_to_wishlist';
EVENT_NAME_INITIATED_CHECKOUT: 'fb_mobile_initiated_checkout';
EVENT_NAME_ADDED_PAYMENT_INFO: 'fb_mobile_add_payment_info';
EVENT_NAME_PURCHASED: 'fb_mobile_purchase';
EVENT_NAME_ACHIEVED_LEVEL: 'fb_mobile_level_achieved';
EVENT_NAME_UNLOCKED_ACHIEVEMENT: 'fb_mobile_achievement_unlocked';
EVENT_NAME_SPENT_CREDITS: 'fb_mobile_spent_credits';
EVENT_PARAM_CURRENCY: 'fb_currency';
EVENT_PARAM_REGISTRATION_METHOD: 'fb_registration_method';
EVENT_PARAM_CONTENT_TYPE: 'fb_content_type';
EVENT_PARAM_CONTENT_ID: 'fb_content_id';
EVENT_PARAM_SEARCH_STRING: 'fb_search_string';
EVENT_PARAM_SUCCESS: 'fb_success';
EVENT_PARAM_MAX_RATING_VALUE: 'fb_max_rating_value';
EVENT_PARAM_PAYMENT_INFO_AVAILABLE: 'fb_payment_info_available';
EVENT_PARAM_NUM_ITEMS: 'fb_num_items';
EVENT_PARAM_LEVEL: 'fb_level';
EVENT_PARAM_DESCRIPTION: 'fb_description';
EVENT_PARAM_SOURCE_APPLICATION: 'fb_mobile_launch_source';
EVENT_PARAM_VALUE_YES: '1';
EVENT_PARAM_VALUE_NO: '0';
};
/**
@@ -178,7 +174,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<FacebookLoginResponse>} Returns a Promise that resolves with a status object if login succeeds, and rejects if login fails.
*/
@Cordova()
login(permissions: string[]): Promise<FacebookLoginResponse> { return; }
login(permissions: string[]): Promise<FacebookLoginResponse> {
return;
}
/**
* Logout of Facebook.
@@ -187,7 +185,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves on a successful logout, and rejects if logout fails.
*/
@Cordova()
logout(): Promise<any> { return; }
logout(): Promise<any> {
return;
}
/**
* Determine if a user is logged in to Facebook and has authenticated your app. There are three possible states for a user:
@@ -216,7 +216,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with a status, or rejects with an error
*/
@Cordova()
getLoginStatus(): Promise<any> { return; }
getLoginStatus(): Promise<any> {
return;
}
/**
* Get a Facebook access token for using Facebook services.
@@ -224,7 +226,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<string>} Returns a Promise that resolves with an access token, or rejects with an error
*/
@Cordova()
getAccessToken(): Promise<string> { return; }
getAccessToken(): Promise<string> {
return;
}
/**
* Show one of various Facebook dialogs. Example of options for a Share dialog:
@@ -244,7 +248,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with success data, or rejects with an error
*/
@Cordova()
showDialog(options: any): Promise<any> { return; }
showDialog(options: any): Promise<any> {
return;
}
/**
* Make a call to Facebook Graph API. Can take additional permissions beyond those granted on login.
@@ -260,7 +266,9 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves with the result of the request, or rejects with an error
*/
@Cordova()
api(requestPath: string, permissions: string[]): Promise<any> { return; }
api(requestPath: string, permissions: string[]): Promise<any> {
return;
}
/**
* Log an event. For more information see the Events section above.
@@ -274,7 +282,9 @@ export class Facebook extends IonicNativePlugin {
successIndex: 3,
errorIndex: 4
})
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> { return; }
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
return;
}
/**
* Log a purchase. For more information see the Events section above.
@@ -284,6 +294,16 @@ export class Facebook extends IonicNativePlugin {
* @returns {Promise<any>}
*/
@Cordova()
logPurchase(value: number, currency: string): Promise<any> { return; }
logPurchase(value: number, currency: string): Promise<any> {
return;
}
/**
* Returns the deferred app link
* @returns {Promise<any>}
*/
@Cordova()
getDeferredApplink(): Promise<string> {
return;
}
}

View File

@@ -74,7 +74,7 @@ export class HTTP extends IonicNativePlugin {
* This returns an object representing a basic HTTP Authorization header of the form.
* @param username {string} Username
* @param password {string} Password
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64encodedusernameandpassword'}
* @returns {Object} an object representing a basic HTTP Authorization header of the form {'Authorization': 'Basic base64EncodedUsernameAndPassword'}
*/
@Cordova({ sync: true })
getBasicAuthHeader(
@@ -283,7 +283,7 @@ export class HTTP extends IonicNativePlugin {
* @param headers {Object} The headers to set for this request
* @param filePath {string} The local path of the file to upload
* @param name {string} The name of the parameter to pass the file along as
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/
@Cordova()
uploadFile(
@@ -292,7 +292,7 @@ export class HTTP extends IonicNativePlugin {
headers: any,
filePath: string,
name: string
): Promise<HTTPResponse> {
): Promise<any> {
return;
}
@@ -301,8 +301,8 @@ export class HTTP extends IonicNativePlugin {
* @param url {string} The url to send the request to
* @param body {Object} The body of the request
* @param headers {Object} The headers to set for this request
* @param filePath {string} The path to donwload the file to, including the file name.
* @returns {Promise<HTTPResponse>} returns a promise that resolve on success, and reject on failure
* @param filePath {string} The path to download the file to, including the file name.
* @returns {Promise<any>} returns a FileEntry promise that resolve on success, and reject on failure
*/
@Cordova()
downloadFile(
@@ -310,7 +310,7 @@ export class HTTP extends IonicNativePlugin {
body: any,
headers: any,
filePath: string
): Promise<HTTPResponse> {
): Promise<any> {
return;
}
}

View File

@@ -291,13 +291,13 @@ export class Ndef extends IonicNativePlugin {
record(tnf: number, type: number[] | string, id: number[] | string, payload: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
textRecord(text: string, languageCode: string, id: number[] | string): NdefRecord { return; }
textRecord(text: string, languageCode?: string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
uriRecord(uri: string, id: number[] | string): NdefRecord { return; }
uriRecord(uri: string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
absoluteUriRecord(uri: string, payload: number[] | string, id: number[] | string): NdefRecord { return; }
absoluteUriRecord(uri: string, payload: number[] | string, id?: number[] | string): NdefRecord { return; }
@Cordova({ sync: true })
mimeMediaRecord(mimeType: string, payload: string): NdefRecord { return; }

View File

@@ -35,7 +35,7 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
@Plugin({
pluginName: 'UserAgent',
plugin: 'cordova-plugin-useragent',
pluginRef: 'plugins.useragent',
pluginRef: 'UserAgent',
repo: 'https://github.com/danielsogl/cordova-plugin-useragent',
platforms: ['Android', 'iOS']
})

View File

@@ -0,0 +1,201 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
/**
* @name Webengage
* @description
* Ionic-Native wrapper that wraps Webengage Cordova plugin for Android and iOS
*
* @usage
* ```typescript
* import { Webengage, WebengageUser, WebengagePush, WebengageNotification } from '@ionic-native/webengage';
*
*
* constructor(private webengage: Webengage, private webengageUser: WebengageUser, private webengagePush: WebengagePush, private webengageNotification: WebengageNotification ) { }
*
* ...
*
* this.webengage.engage();
* ```
*/
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage',
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
})
@Injectable()
export class Webengage extends IonicNativePlugin {
/**
* Initializes WebEngage SDK
* @return {Promise<any>}
*/
@Cordova()
engage(): Promise<any> {
return;
}
/**
* Sets WebEngage SDK configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
/**
* Tracks event
* @param {string} eventName
* @param {any} attributes
* @return {Promise<any>}
*/
@Cordova()
track(eventName: string, attributes: any): Promise<any> {
return;
}
/**
* Tracks screen
* @param {string} eventName
* @param {any} screenData
* @return {Promise<any>}
*/
@Cordova()
screen(screenName: string, screenData: any): Promise<any> {
return;
}
}
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.user',
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
})
@Injectable()
export class WebengageUser extends IonicNativePlugin {
/**
* Logs user in
* @param {string} userId
* @return {Promise<any>}
*/
@Cordova()
login(userId: string): Promise<any> {
return;
}
/**
* Logs user out
* @return {Promise<any>}
*/
@Cordova()
logout(): Promise<any> {
return;
}
/**
* Sets user attribute
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
setAttribute(key: string, value: any): Promise<any> {
return;
}
}
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.push',
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
})
@Injectable()
export class WebengagePush extends IonicNativePlugin {
/**
* Callback function is invoked when a push notification is clicked
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onClick(callback: any): Promise<any> {
return;
}
/**
* Sets push notification configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
}
@Plugin({
pluginName: 'Webengage',
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.notification',
repo: 'https://github.com/WebEngage/cordova-plugin',
install: '',
installVariables: [],
platforms: ['Android', 'iOS']
})
@Injectable()
export class WebengageNotification extends IonicNativePlugin {
/**
* Callback function is invoked when a in-app notification is shown
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onShown(callback: any): Promise<any> {
return;
}
/**
* Callback function is invoked when a in-app notification is clicked
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onClick(callback: any): Promise<any> {
return;
}
/**
* Callback function is invoked when a in-app notification is dismissed
* @param {any} callback
* @return {Promise<any>}
*/
@Cordova()
onDismiss(callback: any): Promise<any> {
return;
}
/**
* Sets in-app notification configuration
* @param {string} key
* @param {any} value
* @return {Promise<any>}
*/
@Cordova()
options(key: string, value: any): Promise<any> {
return;
}
}