1.0.8 • Published 3 years ago

@premind/react-native-premind-android v1.0.8

Weekly downloads
6
License
ISC
Repository
gitlab
Last release
3 years ago

React Native Premind SDK

Get modules

  1. The library is available on npm, install it with:

    npm install @premind/react-native-premind-android

    or

    yarn add @premind/react-native-premind-android

  1. Link the library with your project:

    react-native link @premind/react-native-premind-android

Setup your application

  1. Configure your integration key and secret in the <application ... > tag of your App Manifest file.
    <meta-data android:name="com.premind.premindsdk.KEY" android:value="\ your-KEY-here" />
    <meta-data android:name="com.premind.premindsdk.SECRET" android:value="\ your-SECRET-here" />

  2. Configuration of MainApplication class:
    import com.premind.premindsdk.PremindApplication;

    Change
    public class MainApplication extends Application implements ReactApplication
    To
    public class MainApplication extends PremindApplication implements ReactApplication

Usage

Import it into your project:

import Premind from '@premind/react-native-premind-android'

Authenticate

Authenticate with your own User ID or Token, make sure it is unique and not expired. The return result is true if the authentication is successful.

authenticate = async () => {
    try {
      const result = await Premind.authenticate('userID');     
      if(result == true)
      {
        //authenticate success
        //YOUR_CODE
      }
    } catch (error) {
    
    }
  };

Incognito mode

Get incognito mode (return value is a boolean)

getIsIncognito = async () => {
    try {
      const result = await Premind.getIsIncognito();    
      //YOUR_CODE
    } catch (error) {
    
    }
  };

Set the incognito mode on or off

Premind.setIsIncognito(isIncognito);

Get Me (Profile Info)

const result = await Premind.getMe();

Delete Profile

const result = await Premind.deleteFromProfile(key)
const result = await Premind.deleteVisit(id)
const result = await Premind.deleteInformation(id)

Update Profile

const result = await Premind.updateProfile(key, value)
const result = await Premind.updateInformation(id, key, value)
1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago