Compare commits

..

17 Commits

Author SHA1 Message Date
Ibby Hadeed
9a4e36d9d8 chore(): update changelog 2017-07-07 18:49:34 -04:00
Ibby Hadeed
0e970f5038 3.14.0 2017-07-07 18:49:28 -04:00
Ibby Hadeed
398d0eeac5 feat(in-app-purchase2): add a second InAppPurchase plugin (#1775)
* initial commit for iap2

* fix(iap2): fix events callbacks (#1705)

* fix(iap2): add missing decorator to register function (#1709)

* (feat): change iap2 for callbacks

* (fix): register cordova

* (doc): updated docs with usage example (#1713)

* (feat): change iap2 for callbacks

* (fix): register cordova

* (doc): adding setup for store
2017-07-07 18:46:17 -04:00
Ibby Hadeed
c0d27262e4 chore(): update changelog 2017-07-05 02:43:36 -04:00
Ibby Hadeed
f41dfee912 3.13.1 2017-07-05 02:43:30 -04:00
Ibby Hadeed
f5f92e191a chore(): use same deps as ionic2-app-base 2017-07-05 02:42:37 -04:00
Daniel Sogl
a6ae0919e4 chore(package): bump dev deps (#1747) 2017-07-05 02:41:35 -04:00
Tanay Parikh
5b914d7f15 fix(document-viewer): make config properties optional (#1767)
- Before it forced defining all properties
- Option arguments can be found ![here](https://github.com/sitewaerts/cordova-plugin-document-viewer#options)
2017-07-04 21:30:55 -04:00
Jan Piotrowski
2f3331e9ea docs(): add anchors to make headlines linkable (#1766) 2017-07-04 20:20:37 -04:00
Dhyey Thakore
c972497475 docs(toast): template literal in example usage (#1760)
The single quote needed to be escaped to providing proper syntax highlighting in documentation.
2017-07-04 02:17:19 -04:00
Jimmy Nguyen
3582e877d6 docs(): improve the docs for firebase dynamic links (#1718)
* Improved the docs for firebase dynamic links

The config.xml example needed to switch the ios and android tag.
Added an example how to use onDynamicLink()

* (doc) Reverted change and expanded example

* (doc) Even more comments for clarity
2017-07-03 17:31:02 -04:00
Petros
0c79ac16ec feat(app-rate): add function navigateToAppStore() (#1719) 2017-07-03 17:30:09 -04:00
Thomas
3af23023ee docs(): add example on how to use onChange() method (#1726) 2017-07-03 17:29:52 -04:00
Jan Piotrowski
f289a6bbb6 docs(screen-orientation): fix description (#1743)
by removing outdated sentence and info
2017-07-03 17:28:28 -04:00
jdgeier
e64cc0c61c feat(app-rate): add function handleNegativeFeedback() (#1748) 2017-07-03 17:27:44 -04:00
Ibby Hadeed
7144eb0afa ci(): generate readmes to ensure docs are valid 2017-07-03 07:40:38 -04:00
Ibby Hadeed
fa93226cbf docs(): fix docs 2017-07-03 07:38:36 -04:00
11 changed files with 501 additions and 26 deletions

View File

@@ -1,3 +1,29 @@
<a name="3.14.0"></a>
# [3.14.0](https://github.com/ionic-team/ionic-native/compare/v3.13.1...v3.14.0) (2017-07-07)
### Features
* **in-app-purchase2:** add a second InAppPurchase plugin ([#1775](https://github.com/ionic-team/ionic-native/issues/1775)) ([398d0ee](https://github.com/ionic-team/ionic-native/commit/398d0ee)), closes [#1705](https://github.com/ionic-team/ionic-native/issues/1705)
<a name="3.13.1"></a>
## [3.13.1](https://github.com/ionic-team/ionic-native/compare/v3.13.0...v3.13.1) (2017-07-05)
### Bug Fixes
* **document-viewer:** make config properties optional ([#1767](https://github.com/ionic-team/ionic-native/issues/1767)) ([5b914d7](https://github.com/ionic-team/ionic-native/commit/5b914d7))
### Features
* **app-rate:** add function handleNegativeFeedback() ([#1748](https://github.com/ionic-team/ionic-native/issues/1748)) ([e64cc0c](https://github.com/ionic-team/ionic-native/commit/e64cc0c))
* **app-rate:** add function navigateToAppStore() ([#1719](https://github.com/ionic-team/ionic-native/issues/1719)) ([0c79ac1](https://github.com/ionic-team/ionic-native/commit/0c79ac1))
<a name="3.13.0"></a>
# [3.13.0](https://github.com/ionic-team/ionic-native/compare/v3.12.2...v3.13.0) (2017-07-03)

View File

@@ -34,6 +34,9 @@ jobs:
- run:
name: Build Ionic Native
command: npm run build:core && ./node_modules/.bin/tsc
- run:
name: Generate README files to ensure docs are valid
command: npm run readmes
- run:
name: Run tests
command: npm test

View File

@@ -1,6 +1,6 @@
{
"name": "ionic-native",
"version": "3.13.0",
"version": "3.14.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)",
@@ -39,12 +39,12 @@
"q": "1.5.0",
"queue": "4.2.1",
"rimraf": "2.6.1",
"rxjs": "5.1.1",
"rxjs": "5.4.0",
"semver": "5.3.0",
"tslint": "3.15.1",
"tslint-ionic-rules": "0.0.8",
"typescript": "2.3.3",
"zone.js": "^0.8.11"
"zone.js": "0.8.12"
},
"scripts": {
"start": "npm run test:watch",
@@ -58,7 +58,8 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"postchangelog": "git commit -am \"chore(): update changelog\"",
"test": "karma start karma.conf.js --single-run",
"test:watch": "karma start karma.conf.js"
"test:watch": "karma start karma.conf.js",
"readmes": "gulp readmes"
},
"repository": {
"type": "git",

View File

@@ -127,7 +127,7 @@ docType: "<$ doc.docType $>"
<@- macro documentClass(doc) @>
<@- if doc.statics.length -@>
<h2>Static Members</h2>
<h2><a class="anchor" name="static-members" href="#static-members"></a>Static Members</h2>
<@ for method in doc.statics -@>
<$ documentMethod(method) $>
<@ endfor -@>
@@ -136,7 +136,7 @@ docType: "<$ doc.docType $>"
<# --- methods in class --- #>
<@- if doc.members and doc.members.length @>
<h2>Instance Members</h2>
<h2><a class="anchor" name="instance-members" href="#instance-members"></a>Instance Members</h2>
<@ for method in doc.members -@>
<$ documentMethod(method) $>
<@- endfor @>
@@ -174,7 +174,7 @@ docType: "<$ doc.docType $>"
</p>
<# --- Install commands --- #>
<h2>Installation</h2>
<h2><a class="anchor" name="installation" href="#installation"></a>Installation</h2>
<ol class="installation">
<li>Install the Cordova and Ionic Native plugins:<br>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic cordova plugin add <$ prop.plugin $><@ endif @>
@@ -186,7 +186,7 @@ $ npm install --save @ionic-native/<$ doc.npmId $>
<# --- Plugin supported platforms --- #>
<@ if prop.platforms @>
<h2>Supported platforms</h2>
<h2><a class="anchor" name="platforms" href="#platforms"></a>Supported platforms</h2>
<ul>
<@ for platform in prop.platforms -@>
<li><$ platform $></li>
@@ -198,13 +198,13 @@ $ npm install --save @ionic-native/<$ doc.npmId $>
<# --- Plugin usage --- #>
<@ if doc.usage @>
<h2>Usage</h2>
<h2><a class="anchor" name="usage" href="#usage"></a>Usage</h2>
<$ doc.usage | marked $>
<@ endif @>
<# --- Plugin attributes --- #>
<@- if doc.properties -@>
<h2>Attributes:</h2>
<h2><a class="anchor" name="attributes" href="#attributes"></a>Attributes:</h2>
<table class="table" style="margin:0;">
<thead>
<tr>

View File

@@ -61,6 +61,10 @@ export interface AppRateCallbacks {
* call back function. called when rate-dialog showing
*/
onRateDialogShow?: Function;
/**
* call back function. called when user clicked on negative feedback
*/
handleNegativeFeedback?: Function;
}
@@ -159,4 +163,10 @@ export class AppRate extends IonicNativePlugin {
@Cordova()
promptForRating(immediately: boolean): void { };
/**
* Immediately send the user to the app store rating page
*/
@Cordova()
navigateToAppStore(): void { };
}

View File

@@ -2,29 +2,29 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';
export interface DocumentViewerOptions {
title: string;
documentView: {
title?: string;
documentView?: {
closeLabel: string;
};
navigationView: {
navigationView?: {
closeLabel: string;
};
email: {
email?: {
enabled: boolean;
};
print: {
print?: {
enabled: boolean;
};
openWith: {
openWith?: {
enabled: boolean;
};
bookmarks: {
bookmarks?: {
enabled: boolean;
};
search: {
search?: {
enabled: boolean;
};
autoClose: {
autoClose?: {
onPause: boolean;
};
}

View File

@@ -40,16 +40,21 @@ export interface DynamicLinksOptions {
* constructor(private firebaseDynamicLinks: FirebaseDynamicLinks) { }
*
* ...
*
* // The deepLink and callToActionText properties are optional
* const options: DynamicLinksOptions = {
* title: 'My Title';
* message: 'My message';
* deepLink: 'http://example.com/';
* callToActionText: 'Message on button';
* }
*
* this.firebaseDynamicLinks.sendInvitation(options)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* this.firebaseDynamicLinks.onDynamicLink()
* .then((res: any) => console.log(res)) //Handle the logic here after opening the app with the Dynamic link
* .catch((error:any) => console.log(error));
* ```
*
* @interfaces

View File

@@ -0,0 +1,425 @@
import { Plugin, IonicNativePlugin, Cordova, CordovaProperty } from '@ionic-native/core';
import { Injectable } from '@angular/core';
/**
* @name In App Purchase 2
* @description
* In-App Purchase for Cordova on iOS, Android and Windows
*
* @usage
* ```typescript
* import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2';
*
* constructor(private store: InAppPurchase2) { }
*
* ...
*
* * @advanced
*
* ```typescript
* // After Platform Ready
* this.store.verbosity = this.store.DEBUG;
* this.store.register({
* id: productId,
* alias: productId,
* type: this.store.NON_RENEWING_SUBSCRIPTION
* });
*
* // Register Event Handlers for the specific product
* this.store.when(productId).registered( (product: IAPProduct) => {
* console.log('Registered: ' + JSON.stringify(product));
* });
*
* // Updated
* this.store.when(productId).updated( (product: IAPProduct) => {
* console.log('Loaded' + JSON.stringify(product));
* });
*
* // Issue with buying
* this.store.when(productId).cancelled( (product) => {
* alert('Purchase was Cancelled');
* });
*
* // Track All Store Errors
* this.store.error( (err) => {
* alert('Store Error ' + JSON.stringify(err));
* });
*
* this.store.ready().then((status) => {
* console.log(JSON.stringify(this.store.get(productId)));
* console.log('Store is Ready: ' + JSON.stringify(status));
* console.log('Products: ' + JSON.stringify(this.store.products));
* });
*
*
* // Errors
* this.store.when(productId).error( (error) => {
* this.loader.dismiss();
* alert('An Error Occured' + JSON.stringify(error));
* });
* // Refresh Starts Handlers
* console.log('Refresh Store');
* this.store.refresh();
*
* ...
*
* // To Purchase
* this.store.order(productId);
*
* ```
*
*/
export interface IAPProductOptions {
id: string;
alias: string;
type: string;
}
export type IAPProducts = Array<IAPProduct> & {
/**
* Get product by ID
*/
byId: { [id: string]: IAPProduct; };
/**
* Get product by alias
*/
byAlias: { [alias: string]: IAPProduct; };
/**
* Remove all products (for testing only).
*/
reset: () => {};
};
export type IAPQueryCallback = ((product: IAPProduct) => void) | ((error: IAPError) => void);
export interface IAPProduct {
id: string;
alias: string;
type: string;
state: string;
title: string;
description: string;
priceMicros: string;
price: string;
currency: string;
loaded: boolean;
valid: boolean;
canPurchase: boolean;
owned: boolean;
downloading: boolean;
downloaded: boolean;
additionalData: any;
transaction: any;
finish(): void;
verify(): any;
set(key: string, value: any): void;
stateChanged(): void;
on(event: string, callback: Function): void;
once(event: string, callback: Function): void;
off(callback: Function): void;
trigger(action: string, args: any): void;
}
export interface IAPProductEvents {
loaded: (callback: IAPQueryCallback) => void;
updated: (callback: IAPQueryCallback) => void;
error: (callback: IAPQueryCallback) => void;
approved: (callback: IAPQueryCallback) => void;
owned: (callback: IAPQueryCallback) => void;
cancelled: (callback: IAPQueryCallback) => void;
refunded: (callback: IAPQueryCallback) => void;
registered: (callback: IAPQueryCallback) => void;
valid: (callback: IAPQueryCallback) => void;
invalid: (callback: IAPQueryCallback) => void;
requested: (callback: IAPQueryCallback) => void;
initiated: (callback: IAPQueryCallback) => void;
finished: (callback: IAPQueryCallback) => void;
verified: (callback: IAPQueryCallback) => void;
unverified: (callback: IAPQueryCallback) => void;
expired: (callback: IAPQueryCallback) => void;
downloading: (product: IAPProduct, progress: any, time_remaining: any) => void;
downloaded: (callback: IAPQueryCallback) => void;
}
export class IAPError {
code: number;
message: string;
}
/**
* @name In App Purchase 2
* @description
*
* @usage
* ```
* import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2';
*
*
* constructor(private inAppPurchase2: InAppPurchase2) { }
*
* ...
*
*
* ```
*/
@Plugin({
pluginName: 'InAppPurchase2',
plugin: 'cc.fovea.cordova.purchase',
pluginRef: 'store',
repo: 'https://github.com/j3k0/cordova-plugin-purchase',
platforms: ['iOS', 'Android', 'Windows'],
install: 'ionic cordova plugin add cc.fovea.cordova.purchase --variable BILLING_KEY="<ANDROID_BILLING_KEY>"'
})
@Injectable()
export class InAppPurchase2 extends IonicNativePlugin {
@CordovaProperty
QUIET: number;
@CordovaProperty
ERROR: number;
@CordovaProperty
WARNING: number;
@CordovaProperty
INFO: number;
@CordovaProperty
DEBUG: number;
/**
* Debug level. Use QUIET, ERROR, WARNING, INFO or DEBUG constants
*/
@CordovaProperty
verbosity: number;
/**
* Set to true to invoke the platform purchase sandbox. (Windows only)
*/
@CordovaProperty
sandbox: boolean;
@CordovaProperty
FREE_SUBSCRIPTION: string;
@CordovaProperty
PAID_SUBSCRIPTION: string;
@CordovaProperty
NON_RENEWING_SUBSCRIPTION: string;
@CordovaProperty
CONSUMABLE: string;
@CordovaProperty
NON_CONSUMABLE: string;
@CordovaProperty
ERR_SETUP: number;
@CordovaProperty
ERR_LOAD: number;
@CordovaProperty
ERR_PURCHASE: number;
@CordovaProperty
ERR_LOAD_RECEIPTS: number;
@CordovaProperty
ERR_CLIENT_INVALID: number;
@CordovaProperty
ERR_PAYMENT_CANCELLED: number;
@CordovaProperty
ERR_PAYMENT_INVALID: number;
@CordovaProperty
ERR_PAYMENT_NOT_ALLOWED: number;
@CordovaProperty
ERR_UNKNOWN: number;
@CordovaProperty
ERR_REFRESH_RECEIPTS: number;
@CordovaProperty
ERR_INVALID_PRODUCT_ID: number;
@CordovaProperty
ERR_FINISH: number;
@CordovaProperty
ERR_COMMUNICATION: number;
@CordovaProperty
ERR_SUBSCRIPTIONS_NOT_AVAILABLE: number;
@CordovaProperty
ERR_MISSING_TOKEN: number;
@CordovaProperty
ERR_VERIFICATION_FAILED: number;
@CordovaProperty
ERR_BAD_RESPONSE: number;
@CordovaProperty
ERR_REFRESH: number;
@CordovaProperty
ERR_PAYMENT_EXPIRED: number;
@CordovaProperty
ERR_DOWNLOAD: number;
@CordovaProperty
ERR_SUBSCRIPTION_UPDATE_NOT_AVAILABLE: number;
@CordovaProperty
REGISTERED: string;
@CordovaProperty
INVALID: string;
@CordovaProperty
VALID: string;
@CordovaProperty
REQUESTED: string;
@CordovaProperty
INITIATED: string;
@CordovaProperty
APPROVED: string;
@CordovaProperty
FINISHED: string;
@CordovaProperty
OWNED: string;
@CordovaProperty
DOWNLOADING: string;
@CordovaProperty
DOWNLOADED: string;
@CordovaProperty
INVALID_PAYLOAD: number;
@CordovaProperty
CONNECTION_FAILED: number;
@CordovaProperty
PURCHASE_EXPIRED: number;
@CordovaProperty
products: IAPProducts;
@CordovaProperty
validator: string | ((product: string | IAPProduct, callback: Function) => void);
@CordovaProperty
log: {
error: (message: string) => void;
warn: (message: string) => void;
info: (message: string) => void;
debug: (message: string) => void;
};
/**
* Get product by id or alias
* @param idOrAlias
*/
@Cordova({ sync: true })
get(idOrAlias: string): IAPProduct { return; }
/**
* Register error handler
* @param onError {Function} function to call on error
*/
@Cordova({ sync: true })
error(onError: Function): void {}
/**
* Add or register a product
* @param product {IAPProductOptions}
*/
@Cordova({ sync: true})
register(product: IAPProductOptions): void {}
/**
*
* @param query
* @param event
* @param callback
* @return {IAPProductEvents}
*/
@Cordova({ sync: true })
when(query: string | IAPProduct, event?: string, callback?: IAPQueryCallback): IAPProductEvents { return; }
/**
* Identical to `when`, but the callback will be called only once. After being called, the callback will be unregistered.
* @param query {string | IAPProduct}
* @param [event] {event}
* @param [callback] {IAPQueryCallback}
* @return {IAPProductEvents}
*/
@Cordova({ sync: true })
once(query: string | IAPProduct, event?: string, callback?: IAPQueryCallback): IAPProductEvents { return; }
/**
* Unregister a callback. Works for callbacks registered with ready, when, once and error.
* @param callback {Function}
*/
@Cordova({ sync: true })
off(callback: Function): void {}
@Cordova({ sync: true })
order(product: string | IAPProduct, additionalData?: any): { then: Function; error: Function; } { return; }
/**
*
* @return {Promise<any>} returns a promise that resolves when the store is ready
*/
@Cordova()
ready(): Promise<void> { return; }
@Cordova({ sync: true })
refresh(): void {}
}

View File

@@ -166,7 +166,6 @@ export class QQSDK extends IonicNativePlugin {
/**
* QQ Share Scene
* @type {{QQ: number; QQZone: number; Favorite: number}}
*/
Scene = {
QQ: 0,
@@ -175,7 +174,6 @@ export class QQSDK extends IonicNativePlugin {
};
/**
* client type: QQ application or TIM application
* @type {{QQ: number; TIM: number}}
*/
ClientType = {
QQ: 0,

View File

@@ -5,8 +5,7 @@ import { Observable } from 'rxjs/Observable';
/**
* @name Screen Orientation
* @description
* Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10.
* This plugin is based on an early version of Screen Orientation API so the api does not currently match the current spec.
* Cordova plugin to set/lock the screen orientation in a common way.
*
* Requires Cordova plugin: `cordova-plugin-screen-orientation`. For more info, please see the [Screen Orientation plugin docs](https://github.com/apache/cordova-plugin-screen-orientation).
*
@@ -27,8 +26,16 @@ import { Observable } from 'rxjs/Observable';
*
* // allow user rotate
* this.screenOrientation.unlock();
* ```
*
* // detect orientation changes
* this.screenOrientation.onChange().subscribe(
* () => {
* console.log("Orientation Changed");
* }
* );
*
* ```
*
* @advanced
*
* Accepted orientation values:

View File

@@ -51,7 +51,7 @@ export interface ToastOptions {
*
* ...
*
* this.toast.show('I'm a toast', '5000', 'center').subscribe(
* this.toast.show(`I'm a toast`, '5000', 'center').subscribe(
* toast => {
* console.log(toast);
* }