rn-uuid-generator
A react native based native module for generating Unique User IDentity (UUID). This module is MIT Licensed and is meant for anyone who wants to get
Getting started
$ npm install rn-uuid-generator --save
Expo Managed Application
Sorry, this module does not support Expo, you might like to check any other ways of generating UUIDs inside your application.
Self Managed React Native Application
$ react-native link rn-uuid-generator
-> If this does not seem to work, you can try the following approaches for iOS & Android respectively.
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜rn-uuid-generator
and adduuidGenerator.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNuuidGenerator.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import io.github.traviskn.rnuuidgenerator.uuidGeneratorPackage;
to the imports at the top of the file - Add
new uuidGeneratorPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:
include ':rn-uuid-generator'
project(':rn-uuid-generator').projectDir = new File(rootProject.projectDir, '../node_modules/rn-uuid-generator/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
compile project(':rn-uuid-generator')
Usage
; // Callback interfaceuuidGenerator; // Promise interfaceuuidGenerator ;