npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-google-contact-api

v1.1.1

Published

A package for retrieving Google Contacts and OtherContacts from Google.

Downloads

20

Readme

react-native-google-contact-api

A React Native package that facilitates the retrieval of Google Contacts and Other Contacts from Google. This package utilizes the react-native-google-contact-api library, providing a simple and efficient way to integrate Google Contacts functionality into your React Native applications.

Installation

npm install react-native-google-contact-api

Android Configuration Guide

Firebase Configuration

Obatain SHA1 Key from the KeyStore file, add it to the Firebase Console by following these steps:

  1. Sign in to Firebase and open your project.
  2. Click the Settings icon and select Project settings.
  3. In the Your apps card, select the package name of the app you need to add SHA1 to.
  4. Click "Add fingerprint."

Then, go to Firebase Console, select your app, and add the SHA1 value under Project Settings (gear icon in the upper left) -> Your Apps - SHA certificate fingerprints.

You can get your webClientId from Google Developer Console.

Steps To Generate OAUTH2 webClientId

  1. Create credentials using OAUTH Client ID Configuration.
  2. Select Application Type as Web Application.
  3. Add your Application name and Redirect URI.
  4. The WebClient Id is generated for your application.

Gradle Configuration

If you're running your app in debug mode and not using webClientId or you're sure it's correct, the problem might be a signature (SHA-1 or SHA-256) mismatch. Add the following to android/app/build.gradle:

signingConfigs {
    debug {
        // Add your signing configuration details here
    }
    release {
       // Add your signing configuration details here
    }
}

And Then

 android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }
    .....
}

IOS Configuration Guide

Firebase Configuration

You can get your webClientId from Google Developer Console.

  1. Create Credentials By using OAUTH Client ID Configuration
  2. Select Application Type As IOS
  3. Add Your IOS Application name and Bundle Id
  4. WebClient Id is Generated for Your Application

Usage

Before you can fetch contacts, you need to register your credentials. This process involves obtaining the necessary API keys, tokens, or any other authentication information required by the service or library you are using for contact retrieval.

To register your credentials and integrate them into your React Native application, follow the example code below. This example demonstrates the process of registering API keys for Google Contacts using the react-native-google-contact-api library.

RegisterGoogleClientService

import {
  FetchGoogleContactService,
  FetchGoogleOtherContactService,
  RegisterGoogleClientService,
  ContactResponseDataProps,
  RegisterResponseProps,
  userDataProps,
} from 'react-native-google-contact-api';

 ....


 let userData: userDataProps = {
    ClientId: 'ClientId', // Android or IOS Client id Required
    rediectUrl: 'rediectUrl', // Required for IOS
    appId: 'appId', // Required for Android
    ClientSecret: 'ClientSecret', // Required for Android
};
RegisterGoogleClientService(userData)
.then((res: RegisterResponseProps) => {
     // Response Data
})
.catch((e: any) => {
    // Error Response
});

There are two types of Contact Fetching Methods available in this Package.

  1. FetchGoogleContactService
  2. FetchGoogleOtherContactService

Fetch GoogleContact Service

When dealing with paginated data, services often provide a next_page_token as part of the API response to help fetch subsequent pages of data.

FetchGoogleContactService(next_page_token)  // ===> next_page_token is Optional
.then((res: ContactResponseDataProps) => {
    // Response Data
})
.catch((e: any) => {
  // Error Response
});

Fetch GoogleOtherContact Service

When dealing with paginated data, services often provide a next_page_token as part of the API response to help fetch subsequent pages of data.

FetchGoogleOtherContactService(next_page_token)  // ===> next_page_token is Optional
.then((res: ContactResponseDataProps) => {
    // Response Data
})
.catch((e: any) => {
  // Error Response
});

Response JSON Object

RegisterGoogleClientService() Method Reponse

| Key | Value | Description | | ----------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------- | | status | 1 or 0 | 1 - Success, 0 - Failed
| message | Message about Success or Failure |

FetchGoogleContactService() and FetchGoogleOtherContactService() Methods Reponse

| Key | Value | Description | | ---------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | status | 1 or 0 | 1 - Success, 0 - Failed | | nextPageToken | String | Next page token response from Google.it will return null when next page is empty | | data | User Array List | response user data from Google | message | |Message will receive only Failure

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT