Building apps at a large company? Check out Ionic Enterprise

Device Accounts

Improve this doc

Gets the Google accounts associated with the Android device

Repo: https://github.com/danielsogl/cordova-device-accounts

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-device-accounts
    $ npm install --save @ionic-native/device-accounts
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { DeviceAccounts } from '@ionic-native/device-accounts';

constructor(private deviceAccounts: DeviceAccounts) { }

...

this.deviceAccounts.get()
  .then(accounts => console.log(accounts))
  .catch(error => console.error(error));

Instance Members

get()

Gets all accounts registered on the Android Device

Returns: Promise<any>

getByType()

Get all accounts registered on Android device for requested type

Returns: Promise<any>

getEmails()

Get all emails registered on Android device (accounts with ‘com.google’ type)

Returns: Promise<any>

getEmail()

Get the first email registered on Android device

Returns: Promise<any>

API

Native

General