mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
Merge branch 'master' into v5
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable, fromEvent } from 'rxjs';
|
||||
|
||||
export type AdUnitIDOption = string | {
|
||||
android: string;
|
||||
ios: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* @name AdMob Plus
|
||||
* @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',
|
||||
repo: 'https://github.com/admob-plus/admob-plus',
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -128,6 +128,8 @@ export enum Direction {
|
||||
*
|
||||
* Requires the Cordova plugin: `cordova-plugin-camera`. For more info, please see the [Cordova Camera Plugin Docs](https://github.com/apache/cordova-plugin-camera).
|
||||
*
|
||||
* [Warning] Since IOS 10 the camera requires permissions to be placed in your config.xml add '<config-file parent="NSCameraUsageDescription" platform="ios" target="*-Info.plist"><string>You can take photos</string></config-file> inside of the <platform name='ios> section
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||
|
||||
@@ -60,7 +60,7 @@ export interface CardIOOptions {
|
||||
/**
|
||||
* Changes the color of the guide overlay on the camera. The color is provided in hexadecimal format (e.g. `#FFFFFF`)
|
||||
*/
|
||||
guideColor?: string;
|
||||
guideColor?: string | number;
|
||||
|
||||
/**
|
||||
* The user will not be prompted to confirm their card number after processing.
|
||||
|
||||
@@ -45,6 +45,9 @@ export interface IContactProperties {
|
||||
/** A globally unique identifier. */
|
||||
id?: string;
|
||||
|
||||
/** A globally unique identifier on Android. */
|
||||
rawId?: string;
|
||||
|
||||
/** The name of this Contact, suitable for display to end users. */
|
||||
displayName?: string;
|
||||
|
||||
|
||||
@@ -1091,7 +1091,7 @@ export class File extends IonicNativePlugin {
|
||||
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystem above
|
||||
* @param {string} fileName path relative to base path
|
||||
* @param {string | Blob | ArrayBuffer} text content, blob or ArrayBuffer to write
|
||||
* @param {IWriteOptions} options replace file if set to true. See WriteOptions for more information.
|
||||
* @param {IWriteOptions} whether to replace/append to an existing file. See IWriteOptions for more information.
|
||||
* @returns {Promise<any>} Returns a Promise that resolves to updated file entry or rejects with an error.
|
||||
*/
|
||||
@CordovaCheck()
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @name Firebase Authentication
|
||||
* @description
|
||||
* Cordova plugin for Firebase Authentication
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { FirebaseAuthentication } from '@ionic-native/firebase-authentication/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseAuthentication: FirebaseAuthentication) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.firebaseAuthentication.createUserWithEmailAndPassword('test@gmail.com', '123')
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'FirebaseAuthentication',
|
||||
plugin: 'cordova-plugin-firebase-authentication',
|
||||
pluginRef: 'cordova.plugins.firebase.auth',
|
||||
repo: 'https://github.com/chemerisuk/cordova-plugin-firebase-authentication',
|
||||
install: 'ionic cordova plugin add cordova-plugin-firebase-authentication --variable FIREBASE_AUTH_VERSION=version',
|
||||
installVariables: ['FIREBASE_AUTH_VERSION'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class FirebaseAuthentication extends IonicNativePlugin {
|
||||
/**
|
||||
* Returns a JWT token used to identify the user to a Firebase service.
|
||||
* @param forceRefresh {boolean} Force Refresh
|
||||
* @return {Promise<any>} Returns the id token
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
getIdToken(forceRefresh: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to create a new user account with the given email address and password.
|
||||
* @param email Email
|
||||
* @param password Password
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
createUserWithEmailAndPassword(
|
||||
email: string,
|
||||
password: string
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiates email verification for the current user.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendEmailVerification(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers the Firebase Authentication backend to send a password-reset email to the given email address,
|
||||
* which must correspond to an existing user of your app.
|
||||
* @param email Email
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
sendPasswordResetEmail(email: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronously signs in using an email and password.
|
||||
* @param email Email
|
||||
* @param password Password
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInWithEmailAndPassword(email: string, password: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the phone number verification process for the given phone number.
|
||||
* NOTE: Android supports auto-verify and instant device verification.
|
||||
* Therefore in that cases it doesn't make sense to ask for sms code.
|
||||
* It's recommended to register onAuthStateChanged callback to be notified on auto sign-in.
|
||||
* timeout [milliseconds] is the maximum amount of time you are willing to wait for SMS auto-retrieval
|
||||
* to be completed by the library. Maximum allowed value is 2 minutes. Use 0 to disable SMS-auto-retrieval.
|
||||
* If you specify a positive value less than 30 seconds, library will default to 30 seconds.
|
||||
* @param phoneNumber Phone number
|
||||
* @param timeout {number} Timeout
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
verifyPhoneNumber(phoneNumber: string, timeout: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronously signs in using verificationId and 6-digit SMS code.
|
||||
* @param verificationId Verification ID
|
||||
* @param smsCode SMS code
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInWithVerificationId(
|
||||
verificationId: string,
|
||||
smsCode: number
|
||||
): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and use temporary anonymous account to authenticate with Firebase.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInAnonymously(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses Google's idToken and accessToken to sign-in into firebase account. In order to retrieve those tokens follow instructions for Android and iOS
|
||||
* @param idToken ID Token
|
||||
* @param accessToken Access Token
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInWithGoogle(idToken: string, accessToken: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses Facebook's accessToken to sign-in into firebase account. In order to retrieve those tokens follow instructions for Android and iOS.
|
||||
* @param accessToken Access Token
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInWithFacebook(accessToken: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses Twitter's token and secret to sign-in into firebase account. In order to retrieve those tokens follow instructions for Android and iOS.
|
||||
* @param token Token
|
||||
* @param secret Secret
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signInWithTwitter(token: string, secret: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a block as an auth state did change listener. To be invoked when:
|
||||
* - The block is registered as a listener,
|
||||
* - A user with a different UID from the current user has signed in, or
|
||||
* - The current user has signed out.
|
||||
*/
|
||||
@Cordova({ observable: true, callbackOrder: 'reverse' })
|
||||
onAuthStateChanged(): Observable<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set's the current user language code. The string used to set this property must be a language code that follows BCP 47.
|
||||
* @param languageCode Language Code
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
setLanguageCode(languageCode: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets languageCode to the app’s current language.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
useAppLanguage(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Signs out the current user and clears it from the disk cache.
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
signOut(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,6 +307,17 @@ export class Firebase extends IonicNativePlugin {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the user to set User Identifier for crashlytics reporting
|
||||
* https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0#set_user_ids
|
||||
* @param {string} userId value to set the userId
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
setCrashlyticsUserId(userId: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication
|
||||
* @param {string} phoneNumber The phone number, including '+' and country code
|
||||
|
||||
@@ -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>
|
||||
* ```
|
||||
*
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
|
||||
export interface LineLoginParams {
|
||||
/**
|
||||
* Line Channel ID
|
||||
*/
|
||||
channel_id: string;
|
||||
}
|
||||
|
||||
export interface LineLoginProfile {
|
||||
/**
|
||||
* Line User ID
|
||||
*/
|
||||
userID: string;
|
||||
|
||||
/**
|
||||
* Line Profile Image URL
|
||||
*/
|
||||
pictureURL: string;
|
||||
|
||||
/**
|
||||
* Line Profile Name
|
||||
*/
|
||||
displayName: string;
|
||||
}
|
||||
|
||||
export interface LineLoginAccessToken {
|
||||
/**
|
||||
* Line Access Token
|
||||
*/
|
||||
accessToken: string;
|
||||
|
||||
/**
|
||||
* Line Access Token Expire Time
|
||||
*/
|
||||
expireTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Line Login
|
||||
* @description
|
||||
* The function login, logs out, acquires, verifies, and refreshes the access token. The version of LineSDK you are using is as follows.
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { LineLogin } from '@ionic-native/line-login/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private lineLogin: LineLogin) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.lineLogin.initialize({ channel_id: "xxxxxxxxxx" })
|
||||
*
|
||||
* this.lineLogin.login()
|
||||
* .then(result => console.log(result))
|
||||
* .catch(error => console.log(error))
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* @interfaces
|
||||
* LineLoginParams
|
||||
* LineLoginProfile
|
||||
* LineLoginAccessToken
|
||||
*
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'LineLogin',
|
||||
plugin: 'cordova-line-login-plugin',
|
||||
pluginRef: 'lineLogin',
|
||||
repo: 'https://github.com/nrikiji/cordova-line-login-plugin',
|
||||
install: 'ionic cordova plugin add https://github.com/nrikiji/cordova-line-login-plugin.git --variable LINE_CHANNEL_ID="your_line_channel_id"',
|
||||
installVariables: ['LINE_CHANNEL_ID'],
|
||||
platforms: ['Android', 'iOS']
|
||||
})
|
||||
@Injectable()
|
||||
export class LineLogin extends IonicNativePlugin {
|
||||
/**
|
||||
* Initialize
|
||||
* @param param LineLoginParams
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
initialize(param: LineLoginParams): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login
|
||||
* @return {Promise<LineLoginProfile>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
login(): Promise<LineLoginProfile> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login with Web
|
||||
* (iOS only)
|
||||
* @return {Promise<LineLoginProfile>}
|
||||
*/
|
||||
@Cordova({
|
||||
successIndex: 1,
|
||||
errorIndex: 2
|
||||
})
|
||||
loginWeb(): Promise<LineLoginProfile> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logout(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Access Token
|
||||
* @return {Promise<LineLoginAccessToken>}
|
||||
*/
|
||||
@Cordova()
|
||||
getAccessToken(): Promise<LineLoginAccessToken> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify AccessToken
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
verifyAccessToken(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh Access Token
|
||||
* @return {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
refreshAccessToken(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,17 @@ import { Observable, merge } from 'rxjs';
|
||||
|
||||
declare const navigator: any;
|
||||
|
||||
export enum Connection {
|
||||
UNKNOWN = 0,
|
||||
ETHERNET,
|
||||
WIFI,
|
||||
CELL_2G,
|
||||
CELL_3G ,
|
||||
CELL_4G,
|
||||
CELL,
|
||||
NONE
|
||||
}
|
||||
|
||||
/**
|
||||
* @name Network
|
||||
* @description
|
||||
@@ -23,7 +34,7 @@ declare const navigator: any;
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* // watch network for a disconnect
|
||||
* // watch network for a disconnection
|
||||
* let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
|
||||
* console.log('network was disconnected :-(');
|
||||
* });
|
||||
@@ -61,6 +72,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}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -334,19 +334,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) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||
* @description
|
||||
* Share text, files, images, and links via social networks, sms, and email.
|
||||
*
|
||||
* For Browser usage check out the Web Share API docs: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin#web-share-api
|
||||
* For Browser usage check out the Web Share API docs: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin#5-web-share-api
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
|
||||
@@ -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; }
|
||||
|
||||
/**
|
||||
|
||||
@@ -161,7 +161,7 @@ export class SQLiteObject {
|
||||
* .then((db: SQLiteObject) => {
|
||||
*
|
||||
*
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', {})
|
||||
* db.executeSql('create table danceMoves(name VARCHAR(32))', [])
|
||||
* .then(() => console.log('Executed SQL'))
|
||||
* .catch(e => console.log(e));
|
||||
*
|
||||
|
||||
@@ -49,7 +49,9 @@ export class TapticEngine extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
notification(options: { type: string }): Promise<any> {
|
||||
notification(options: {
|
||||
type: 'success' | 'warning' | 'error';
|
||||
}): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,7 +62,7 @@ export class TapticEngine extends IonicNativePlugin {
|
||||
* @returns {Promise<any>} Returns a promise that resolves on success and rejects on error
|
||||
*/
|
||||
@Cordova()
|
||||
impact(options: { style: string }): Promise<any> {
|
||||
impact(options: { style: 'light' | 'medium' | 'heavy' }): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user