@premind/react-native-premind-android v1.0.8
React Native Premind SDK
Get modules
The library is available on npm, install it with:
npm install @premind/react-native-premind-android
or
yarn add @premind/react-native-premind-android
Link the library with your project:
react-native link @premind/react-native-premind-android
Setup your application
Configure your integration
key
andsecret
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" />
Configuration of MainApplication class:
import com.premind.premindsdk.PremindApplication;
Change
public class MainApplication extends Application implements ReactApplication
Topublic 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)