Get persistent unique identifier in android & ios both
npm install rn-unique-identifier
npm install rn-unique-identifier
`
$3
Import the module in your React Native application and use it to obtain the persistent identifier:Example App.jsx(javascript)
`
import React, { useEffect } from 'react';
import { View, Text } from 'react-native';
import UniqueIdentifier from 'rn-unique-identifier';const App = () => {
useEffect(() => {
const identifier = UniqueIdentifier.getPersistentIdentifier();
console.log('Persistent Identifier:', identifier);
}, []);
return (
Check the console for the Persistent Identifier.
);
};
export default App;
`
$3
`
While running the gradlew(creating the build) use this first:
./gradlew generateCodegenArtifactsFromSchema
`$3
`
While installing pods use this command:
RCT_NEW_ARCH_ENABLED=1 pod install
``