jose2007kj / accountManager

React Native library to list out all the accounts (Facebook, Twitter, Gmail, etc) in Android

Home Page:https://stackoverflow.com/questions/13244130/how-to-list-out-all-the-accounts-facebook-twitter-gmail-etc-in-android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-account-manager

Getting started

$ npm install git+https://git@github.com/jose2007kj/accountManager.git --save

Mostly automatic installation

$ react-native link react-native-account-manager

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.jose2007kj.reactnative.RNAccountManagerPackage; to the imports at the top of the file
  • Add new RNAccountManagerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-account-manager'
    project(':react-native-account-manager').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-account-manager/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-account-manager')
    
  3. Insert the following permision in android/src/app/main/androidmanifest.xml:
      <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    

Usage

import RNAccountManager from 'react-native-account-manager';

// TODO: What to do with the module? this print all account info like in this question https://stackoverflow.com/questions/13244130/how-to-list-out-all-the-accounts-facebook-twitter-gmail-etc-in-android
 RNAccountManager.getAccounts().then(account => {
            console.log('account info'+account.account);
            })
            .catch(error => {
              console.log(error)
            })

About

React Native library to list out all the accounts (Facebook, Twitter, Gmail, etc) in Android

https://stackoverflow.com/questions/13244130/how-to-list-out-all-the-accounts-facebook-twitter-gmail-etc-in-android


Languages

Language:Java 99.3%Language:JavaScript 0.7%