Compare commits

..
15 Commits
Author SHA1 Message Date
Daniel 2933d40cdc chore(): update changelog 2018-10-17 19:55:57 +02:00
Daniel 874ae88ff4 4.16.0 2018-10-17 19:55:52 +02:00
MarcoandDaniel Sogl a02ca715e9 docs(one-signal): fix target url for notification icon (#2780)
The correct path is described at the official documentation from OneSignal. 
Link: https://documentation.onesignal.com/docs/customize-notification-icons
2018-10-17 19:53:44 +02:00
Daniel SoglandGitHub 336b3ff89b fix(local-notifications): add missing functions (#2779)
closes: #2778
2018-10-17 19:53:22 +02:00
Stephen WolffandDaniel Sogl 2aa73b5546 feat(nfc): add NFC readerMode (#2777)
* Work on NFC reader-mode

* Remove dist files, not needed in plugin development folder

* Revert package changes

This reverts part of commit 24a893fdcf.

* Update index.ts

* Correct the flags and return types for the wrapper

* Add reader flags.

Thanks @sfaizanh
2018-10-17 19:52:52 +02:00
Jordan BengeandDaniel Sogl 99cebcba0b feat(lastCam): add plugin (#2759)
* feat(lastCam): add plugin

* feat: added watchRecordingTimer observer

* fix(lastCam): update plugin name

* refactor: lint file and refactor description
2018-10-17 19:52:39 +02:00
Paul StelzerandDaniel Sogl 6c99ec8033 feat(admob-plus): Add admob-plus (#2753) 2018-10-17 19:52:25 +02:00
Faizan HasanandDaniel Sogl a167bd85aa fix(keyboard) isVisible property missing (#2751)
* isVisible property missing

* fix(lint)

* fix(lint) CI

* fix(CordovaProperty) Imported CordovaProperty from core
2018-10-14 13:31:01 +02:00
Niklas MerzandDaniel Sogl 487acd603b refactor(network): add enum for connection types (#2754) 2018-10-14 13:30:34 +02:00
SultanandDaniel Sogl fb4d2640c1 docs(apple-wallet): update example (#2755)
* Add AppleWallet class interface

* Update index.ts

* Update index.ts

* update readme
2018-10-14 13:30:25 +02:00
Markus KarileetandDaniel Sogl 4468b520ad feat(speechkit): plugin updated with voice parameter (#2761) 2018-10-14 13:30:11 +02:00
BradyShoberandDaniel Sogl 1a2dc3ee73 feat(firebase-messaging): add revokeToken function (#2763) 2018-10-14 13:30:00 +02:00
Max LynchandGitHub 00a1674fd6 Merge pull request #2758 from ajcrites/geo-msg
docs(geolocation): use more generic / professional message
2018-10-03 18:07:12 -05:00
Andrew Crites 2b14bd979e docs(geolocation): use more generic / professional message 2018-10-03 18:59:43 -04:00
Daniel SoglandGitHub fcd6d26727 fix(keyboard): add missing property 2018-09-25 17:11:43 +02:00
14 changed files with 374 additions and 44 deletions
+20
View File
@@ -1,3 +1,23 @@
<a name="4.16.0"></a>
# [4.16.0](https://github.com/ionic-team/ionic-native/compare/v4.15.0...v4.16.0) (2018-10-17)
### Bug Fixes
* **keyboard:** add missing property ([fcd6d26](https://github.com/ionic-team/ionic-native/commit/fcd6d26))
* **local-notifications:** add missing functions ([#2779](https://github.com/ionic-team/ionic-native/issues/2779)) ([336b3ff](https://github.com/ionic-team/ionic-native/commit/336b3ff)), closes [#2778](https://github.com/ionic-team/ionic-native/issues/2778)
### Features
* **admob-plus:** Add admob-plus ([#2753](https://github.com/ionic-team/ionic-native/issues/2753)) ([6c99ec8](https://github.com/ionic-team/ionic-native/commit/6c99ec8))
* **firebase-messaging:** add revokeToken function ([#2763](https://github.com/ionic-team/ionic-native/issues/2763)) ([1a2dc3e](https://github.com/ionic-team/ionic-native/commit/1a2dc3e))
* **lastCam:** add plugin ([#2759](https://github.com/ionic-team/ionic-native/issues/2759)) ([99cebcb](https://github.com/ionic-team/ionic-native/commit/99cebcb))
* **nfc:** add NFC readerMode ([#2777](https://github.com/ionic-team/ionic-native/issues/2777)) ([2aa73b5](https://github.com/ionic-team/ionic-native/commit/2aa73b5))
* **speechkit:** plugin updated with voice parameter ([#2761](https://github.com/ionic-team/ionic-native/issues/2761)) ([4468b52](https://github.com/ionic-team/ionic-native/commit/4468b52))
<a name="4.15.0"></a>
# [4.15.0](https://github.com/ionic-team/ionic-native/compare/v4.14.0...v4.15.0) (2018-09-25)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "4.15.0",
"version": "4.16.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "4.15.0",
"version": "4.16.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)",
@@ -0,0 +1,93 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { fromEvent } from 'rxjs/observable/fromEvent';
export type AdUnitIDOption = string | {
android: string;
ios: string;
};
/**
* @name AdMob Free
* @description
* AdMob Plus is the successor of cordova-plugin-admob-free, which provides a cleaner API and build with modern tools.
*/
@Plugin({
plugin: 'cordova-admob-plus',
pluginName: 'AdMob',
pluginRef: 'admob.banner',
})
export class Banner {
@Cordova({ otherPromise: true })
hide(): Promise<any> {
return Promise.resolve();
}
@Cordova({ otherPromise: true })
show(opts: { id?: AdUnitIDOption }): Promise<any> {
return Promise.resolve();
}
}
@Plugin({
plugin: 'cordova-admob-plus',
pluginName: 'AdMob',
pluginRef: 'admob.interstitial',
})
export class Interstitial {
@Cordova({ otherPromise: true })
load(opts: { id?: AdUnitIDOption }): Promise<any> {
return Promise.resolve();
}
@Cordova({ otherPromise: true })
show(): Promise<any> {
return Promise.resolve();
}
}
@Plugin({
plugin: 'cordova-admob-plus',
pluginName: 'AdMob',
pluginRef: 'admob.rewardVideo',
})
export class RewardVideo {
@Cordova({ otherPromise: true })
load(opts: { id?: AdUnitIDOption }): Promise<any> {
return Promise.resolve();
}
@Cordova({ otherPromise: true })
show(): Promise<any> {
return Promise.resolve();
}
}
@Plugin({
platforms: ['Android', 'iOS'],
plugin: 'cordova-admob-plus',
pluginName: 'AdMob',
pluginRef: 'admob',
repo: 'https://github.com/admob-plus/admob-plus',
})
@Injectable()
export class AdMob extends IonicNativePlugin {
banner = new Banner();
interstitial = new Interstitial();
rewardVideo = new RewardVideo();
@Cordova({ otherPromise: true })
setAppMuted(value: boolean): Promise<any> {
return Promise.resolve();
}
@Cordova({ otherPromise: true })
setAppVolume(value: number): Promise<any> {
return Promise.resolve();
}
on(event: string): Observable<any> {
return fromEvent(document, event);
}
}
@@ -11,7 +11,7 @@ export interface CardData {
cardholderName: string;
primaryAccountNumberSuffix: string;
localizedDescription?: string;
paymentNetwork: string;
paymentNetwork?: string;
}
/**
@@ -26,20 +26,28 @@ export interface CardData {
*
* constructor(private appleWallet: AppleWallet) { }
*
*
* ...
*
*
* // Simple call to check whether the app can add cards to Apple Pay.
* this.appleWallet.available()
* .then((res) => {
* // res is a boolean value, either true or false
* console.log("Is Apple Wallet available? ", res);
* // Apple Wallet is enabled and a supported card is setup. Expect:
* // boolean value, true or false
* })
* .catch((message) => {
* console.error("ERROR AVAILBLE>> ", message);
* // Error message while trying to know if device is able to add to wallet
* });
*
*
* ...
*
*
* // Simple call with the configuration data needed to instantiate a new PKAddPaymentPassViewController object.
* // The encryption scheme, cardholder name, and primary account suffix are required for configuration.
* // The configuration information is used for setup and display only. It should not contain any sensitive information.
*
* let data: cardData = {
* cardholderName: 'Test User',
* primaryAccountNumberSuffix: '1234',
@@ -49,14 +57,32 @@ export interface CardData {
*
* this.appleWallet.startAddPaymentPass(data: cardData)
* .then((res) => {
* console.log("startAddPaymentPass success response ", res);
* // User proceed and successfully asked to add card to his wallet
* // Use the callback response JSON payload to complete addition process
* })
* .catch((err) => {
* console.error("startAddPaymentPass ERROR response", err);
* // Error or user cancelled.
* });
*
* // You should expect the callback success response to be as follow
*
* // {
* // data: {
* // "certificateSubCA": "Base64 string represents certificateSubCA",
* // "certificateLeaf":" Base64 string represents certificateLeaf"
* // "nonce": "Base64 string represents nonce",
* // "nonceSignature": "Base64 string represents nonceSignature",
* // }
* // }
*
* // This method provides the data needed to create an add payment request.
* // Pass the certificate chain to the issuer server. The server returns an encrypted JSON file containing the card data.
* // After you receive the encrypted data, pass it to completeAddPaymentPass method
*
*
* ...
*
*
* let data: encryptedCardData = {
* activationData: 'encoded Base64 activationData from your server',
* encryptedPassData: 'encoded Base64 encryptedPassData from your server',
@@ -65,10 +91,12 @@ export interface CardData {
*
* this.appleWallet.encryptedCardData(data: encryptedCardData)
* .then((res) => {
* console.log("completeAddCardToAppleWallet success response ", res);
* // callback success response means card has been added successfully,
* // PKAddPaymentPassViewController will be dismissed
* })
* .catch((err) => {
* console.error("completeAddCardToAppleWallet ERROR response", err);
* // Error and can not add the card, or something wrong happend
* // PKAddPaymentPassViewController will be dismissed
* });
*
* ```
@@ -133,4 +133,14 @@ export class FirebaseMessaging extends IonicNativePlugin {
setBadge(value: number): Promise<null> {
return;
}
/**
* Revoke the current FCM token.
*
* @returns {Promise<null>}
*/
@Cordova({ sync: true })
revokeToken(): Promise<null> {
return;
}
}
@@ -114,7 +114,7 @@ export interface GeolocationOptions {
* For iOS you have to add this configuration to your configuration.xml file
* ```xml
* <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
* <string>We want your location! Best regards NSA</string>
* <string>We use your location for full functionality of certain app features.</string>
* </edit-config>
* ```
*
+11 -2
View File
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Cordova, CordovaProperty, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
/**
@@ -32,6 +32,14 @@ import { Observable } from 'rxjs/Observable';
})
@Injectable()
export class Keyboard extends IonicNativePlugin {
/**
* Check keyboard status visible or not.
* @returns {boolean}
*/
@CordovaProperty
isVisible: boolean;
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
* @param hide {boolean}
@@ -59,12 +67,13 @@ export class Keyboard extends IonicNativePlugin {
/**
* Programmatically set the resize mode
* @param mode {string}
*/
@Cordova({
sync: true,
platforms: ['iOS']
})
setResizeMode(): void {}
setResizeMode(mode: string): void {}
/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
+137
View File
@@ -0,0 +1,137 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
export interface LastCamStartupOptions {
/** The left edge in pixels, default 0 */
x?: number;
/** The top edge in pixels, default 0 */
y?: number;
/** The width in pixels, default window.screen.width */
width?: number;
/** The height in pixels, default window.screen.height */
height?: number;
/** Choose the camera to use 'front' or 'back', default 'front' */
camera?: string;
}
/**
* @name LastCam
* @description
* Last Cam is a Camera Preview plugin that allows you to take capture both Videos and images in a
* custom html preview of your choice.
*
* @interfaces
* LastCamStartupOptions
*/
@Plugin({
pluginName: 'LastCam',
plugin: 'cordova-plugin-last-cam',
pluginRef: 'LastCam',
repo: 'https://github.com/bengejd/cordova-plugin-last-cam',
platforms: ['iOS']
})
@Injectable()
export class LastCam extends IonicNativePlugin {
/**
* Starts the camera preview instance.
* @param {LastCamStartupOptions} options
* @return {Promise<any>}
*/
@Cordova({
successIndex: 1,
errorIndex: 2
})
startCamera(options: LastCamStartupOptions): Promise<any> {
return;
}
/**
* Stops the camera preview instance. (iOS)
* @return {Promise<any>}
*/
@Cordova()
stopCamera(): Promise<any> {
return;
}
/**
* Switch from the rear camera and front camera, if available.
* @return {Promise<any>}
*/
@Cordova()
switchCamera(): Promise<any> {
return;
}
/**
* Switch the flash mode.
* @return {Promise<any>}
*/
@Cordova()
switchFlash(): Promise<any> {
return;
}
/**
* Take the picture (base64)
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
takePicture(): Promise<any> {
return;
}
/**
* Start the video capture
* @return {Promise<any>}
*/
@Cordova()
startVideoCapture(): Promise<any> {
return;
}
/**
* Stops the video capture
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
stopVideoCapture(): Promise<any> {
return;
}
/**
* Promise of the recordingTimer.
* @return {Promise<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1
})
recordingTimer(): Promise<any> {
return;
}
/**
* Observable of the recordingTimer.
* @return {Observable<any>}
*/
@Cordova({
successIndex: 0,
errorIndex: 1,
observable: true
})
watchRecordingTimer(): Observable<any> {
return;
}
}
@@ -653,26 +653,6 @@ export class LocalNotifications extends IonicNativePlugin {
return;
}
/**
* Get a scheduled notification object
* @param notificationId {any} The id of the notification to get
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
getScheduled(notificationId: any): Promise<ILocalNotification> {
return;
}
/**
* Get a triggered notification object
* @param notificationId The id of the notification to get
* @returns {Promise<ILocalNotification>}
*/
@Cordova()
getTriggered(notificationId: any): Promise<ILocalNotification> {
return;
}
/**
* Adds a group of actions
* @param groupId The id of the action group
@@ -727,20 +707,20 @@ export class LocalNotifications extends IonicNativePlugin {
}
/**
* Get all scheduled notification objects
* List of all scheduled notifications
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllScheduled(): Promise<ILocalNotification[]> {
getScheduled(): Promise<ILocalNotification[]> {
return;
}
/**
* Get all triggered notification objects
* List of all triggered notifications
* @returns {Promise<Array<ILocalNotification>>}
*/
@Cordova()
getAllTriggered(): Promise<ILocalNotification[]> {
getTriggered(): Promise<ILocalNotification[]> {
return;
}
@@ -11,6 +11,17 @@ import { merge } from 'rxjs/observable/merge';
declare const navigator: any;
export enum Connection {
UNKNOWN = 0,
ETHERNET,
WIFI,
CELL_2G,
CELL_3G ,
CELL_4G,
CELL,
NONE
}
/**
* @name Network
* @description
@@ -62,6 +73,21 @@ declare const navigator: any;
})
@Injectable()
export class Network extends IonicNativePlugin {
/**
* Constants for possible connection types
*/
Connection = {
UNKNOWN: 'unknown',
ETHERNET: 'ethernet',
WIFI: 'wifi',
CELL_2G: '2g',
CELL_3G: '3g',
CELL_4G: '4g',
CELL: 'cellular',
NONE: 'none'
};
/**
* Connection type
* @return {string}
+25
View File
@@ -76,6 +76,15 @@ export interface NdefTag {
*/
@Injectable()
export class NFC extends IonicNativePlugin {
FLAG_READER = {
NFC_A: 0,
NFC_B: 0x2,
NFC_F: 0x4,
NFC_V: 0x8,
NFC_BARCODE: 0x10,
SKIP_NDEF_CHECK: 0x80,
NO_PLATFORM_SOUNDS: 0x100,
};
/**
* Starts the NFCNDEFReaderSession allowing iOS to scan NFC tags.
* @param onSuccess
@@ -286,6 +295,22 @@ export class NFC extends IonicNativePlugin {
bytesToHexString(bytes: number[]): string {
return;
}
/**
* Read NFC tags sending the tag data to the success callback.
*/
@Cordova({
observable: true,
successIndex: 1,
errorIndex: 4,
clearFunction: 'disableReaderMode',
clearWithArgs: true
})
readerMode(
flags: number,
readCallback?: Function,
errorCallback?: Function
): void { return; }
}
/**
* @hidden
+5 -5
View File
@@ -331,19 +331,19 @@ export enum OSActionType {
*
* var filestocopy = [{
* "resources/android/icon/drawable-hdpi-icon.png":
* "platforms/android/res/drawable-hdpi/ic_stat_onesignal_default.png"
* "platforms/android/app/src/main/res/drawable-hdpi/ic_stat_onesignal_default.png"
* }, {
* "resources/android/icon/drawable-mdpi-icon.png":
* "platforms/android/res/drawable-mdpi/ic_stat_onesignal_default.png"
* "platforms/android/app/src/main/res/drawable-mdpi/ic_stat_onesignal_default.png"
* }, {
* "resources/android/icon/drawable-xhdpi-icon.png":
* "platforms/android/res/drawable-xhdpi/ic_stat_onesignal_default.png"
* "platforms/android/app/src/main/res/drawable-xhdpi/ic_stat_onesignal_default.png"
* }, {
* "resources/android/icon/drawable-xxhdpi-icon.png":
* "platforms/android/res/drawable-xxhdpi/ic_stat_onesignal_default.png"
* "platforms/android/app/src/main/res/drawable-xxhdpi/ic_stat_onesignal_default.png"
* }, {
* "resources/android/icon/drawable-xxxhdpi-icon.png":
* "platforms/android/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
* "platforms/android/app/src/main/res/drawable-xxxhdpi/ic_stat_onesignal_default.png"
* } ];
*
* module.exports = function(context) {
+4 -2
View File
@@ -13,7 +13,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
* constructor(private speechkit: SpeechKit) { }
*
*
* this.speechkit.tts('Text to be read out loud', 'ENG-GBR').then(
* // find voice names that match language from: https://developer.nuance.com/public/index.php?task=supportedLanguages
* this.speechkit.tts('Text to be read out loud', 'ENG-GBR', 'Serena').then(
* (msg) => { console.log(msg); },
* (err) => { console.log(err); }
* );
@@ -36,7 +37,8 @@ export class SpeechKit extends IonicNativePlugin {
@Cordova()
tts(
text: string,
language: string
language: string,
voice: string
): Promise<string> { return; }
/**