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-fabric-digits

v1.0.28

Published

Fabric Digits wrapper to use it in React-Native

Downloads

58

Readme

react-native-fabric-digits

Introduction

Fabric Digits wrapper for React-Native.

Special thanks to the following people/projects:

Before Installing

  1. Open your React Native app in Xcode / Android Studio / similar
  2. Install DigitsKit (the same way you would for non-React Native projects)

For iOS apps, you can install DigitsKit either through the Fabric OS X app or CocoaPods

For Android apps, you can install DigitsKit either through the Fabric IDE plugin or Gradle

Don't forget about initializing Fabric using with method!

Install

npm install JeanLebrument/react-native-fabric-digits --save

Either Link with RNPM... (Automatic)

  1. npm install rnpm -g --save
  2. rnpm link react-native-fabric-digits

...or Link (Manual)

iOS procedure

  1. Follow the usual Digits installation procedure on your project, including adding the frameworks and modifying any files.
  2. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ Add Files to <...>
  3. Go to node_modulesreact-native-fabric-digitsios -> select the RCTDigitsManager.xcodeproj
  4. Go to Build Phases tab of your project, select a target, open Link Binary With Libraries, click on + and add libRCTDigitsManager.a

Android procedure

In settings.gradle

Add to bottom:

include ':react-native-fabric-digits'
project(':react-native-fabric-digits').projectDir = new File(settingsDir, '../node_modules/react-native-fabric-digits/android')

In android/build.gradle

allprojects {
  repositories {
    mavenLocal()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }   <--- ADD THIS
  }
}

In android/app/build.gradle

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:23.0.0'
  compile 'com.facebook.react:react-native:0.14.+'
  compile project(':react-native-fabric-digits')          <--- ADD THIS
}

In MainActivity.java

import com.proxima.RCTDigits.DigitsPackage;         <--- ADD THIS

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new DigitsPackage()                         <--- ADD THIS
      );
    }

In AndroidManifest.xml

Add this inside the application tag.

<meta-data
  android:name="io.Digits.ApiKey"
  android:value="YOUR_API_KEY" />
<meta-data
  android:name="io.Digits.ApiSecret"
  android:value="YOUR_API_SECRET" />

Styling on Android

On Android, you have to add a custom Digits Theme in your app's styles resource.

In android/app/src/main/res/values/styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <!-- your other app styles here -->

  <style name="CustomDigitsTheme" parent="android:Theme.Material.Light">
    <item name="android:textColorPrimary">@android:color/black</item>
    <item name="android:textColorSecondary">@android:color/darker_gray</item>
    <item name="android:windowBackground">@android:color/white</item>
    <item name="android:textColorLink">#ff398622</item>
    <item name="android:colorAccent">#ff398622</item>
  </style>
</resources>

See the Digits Android Theming docs for more information: Digits Android Theming

Usage

This package provide two classes: DigitsLoginButton and DigitsLogoutButton. You should render the version that corresponds to the Log In state in your app.

Start with DigitsLoginButton, then when a user has successfully logged in, swap this out for DigitsLogoutButton.

Have a look at the Example, which illustrates all the features.

FAQ

What's Digits?

  • please see https://get.digits.com. Digits is part of Fabric -- a suite of tools for building mobile apps from Twitter.

Does Digits officially support React Native?

  • Not directly on its own. Officially, DigitsKit only supports the native languages (Objective C, Swift, and Java).
  • However, React Native has the ability to expose native modules to JavaScript components, which is exactly what this library does.

Can I see the OAuth details that the DigitsAPI returns?

  • In our example, the returned OAuth response is put into the component state.

Can I see the phone number the user entered?

  • Yes! Once a user has logged in, you can call getSessionDetails() to get the sessionId and phoneNumber.

Licence

MIT