Socket
Book a DemoInstallSign in
Socket

react-native-get-shared-prefs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-get-shared-prefs

This module was produced by ClassApp Team and will be improved in future updates. `react-native-get-shared-prefs` gets all information stored in Android shared preferences.

1.0.7
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Introduction

This module was produced by ClassApp Team and will be improved in future updates. react-native-get-shared-prefs gets all information stored in Android shared preferences.

Install

Install react-native-get-shared-prefs using:

npm i -S react-native-get-shared-prefs

After that, you should link react-native-get-shared-prefs in your project, to do so:

rnpm link react-native-get-shared-prefs

or

Go to settings.gradle inside your android project folder and paste this lines there:

include ':react-native-get-shared-prefs'
project(':react-native-get-shared-prefs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-shared-prefs/android')

and paste it into build.gradle:

compile project(':react-native-get-shared-prefs')

In your MainActivity.java add:

import br.com.classapp.RNGetSharedPrefs.RNGetSharedPrefsPackage; //<- You must import this

protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new RNGetSharedPrefsPackage(), // <- Add this line
    );
}

Sync gradle and go :)

How to use?

Here is a simple example:

import SharedPrefs from 'react-native-get-shared-prefs';

SharedPrefs.getSharedPrefs(function(result){
    //result = { 'key1':'value1', 'key2': 'value2', 'key3': 'value3'}

    console.log(result); //It will display your data from Shared Preferences

});

Here is an output example:

example

Future Works

  • Add more features

FAQs

Package last updated on 17 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.