Files
awesome-cordova-plugins/src/@ionic-native/plugins/device-accounts/index.ts
T

62 lines
1.4 KiB
TypeScript
Raw Normal View History

import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';
2016-07-08 00:52:13 +02:00
/**
* @name Device Accounts
* @description
* Gets the Google accounts associated with the Android device
*
* @usage
* ```typescript
* import { DeviceAccounts } from '@ionic-native/device-accounts';
*
* constructor(private deviceAccounts: DeviceAccounts) { }
*
* ...
*
* this.deviceAccounts.get()
* .then(accounts => console.log(accounts))
* .catch(error => console.error(error));
*
* ```
*/
2016-07-08 00:52:13 +02:00
@Plugin({
pluginName: 'DeviceAccounts',
2016-07-08 00:52:13 +02:00
plugin: 'https://github.com/loicknuchel/cordova-device-accounts.git',
pluginRef: 'plugins.DeviceAccounts',
repo: 'https://github.com/loicknuchel/cordova-device-accounts',
platforms: ['Android']
})
@Injectable()
2016-07-08 00:52:13 +02:00
export class DeviceAccounts {
/**
* Gets all accounts registered on the Android Device
* @returns {Promise<any>}
2016-07-08 00:52:13 +02:00
*/
@Cordova()
get(): Promise<any> { return; }
2016-07-08 00:52:13 +02:00
/**
* Get all accounts registered on Android device for requested type
* @returns {Promise<any>}
2016-07-08 00:52:13 +02:00
*/
@Cordova()
getByType(type: string): Promise<any> { return; }
2016-07-08 00:52:13 +02:00
/**
* Get all emails registered on Android device (accounts with 'com.google' type)
* @returns {Promise<any>}
2016-07-08 00:52:13 +02:00
*/
@Cordova()
getEmails(): Promise<any> { return; }
2016-07-08 00:52:13 +02:00
/**
* Get the first email registered on Android device
* @returns {Promise<any>}
2016-07-08 00:52:13 +02:00
*/
@Cordova()
getEmail(): Promise<any> { return; }
2016-07-20 17:17:09 +02:00
2016-07-08 00:52:13 +02:00
}