Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Text,
useColorScheme,
View,
Button,
} from 'react-native';

import {
Expand All @@ -25,6 +26,8 @@ import {
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

import {useVisitorData} from '@fingerprintjs/fingerprintjs-pro-react-native';

type SectionProps = PropsWithChildren<{
title: string;
}>;
Expand Down Expand Up @@ -62,6 +65,8 @@ function App(): React.JSX.Element {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};

const {isLoading, error, data, getData} = useVisitorData()

return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
Expand All @@ -76,6 +81,18 @@ function App(): React.JSX.Element {
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Button title='Reload data' onPress={() => getData()} />
{isLoading ? (
<Text>Loading...</Text>
) : (
<>
<Text>VisitorId: {data?.visitorId}</Text>
<Text>Full visitor data:</Text>
<Text>
{error ? error.message : JSON.stringify(data, null, 2)}
</Text>
</>
)}
<Section title="Step One">
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
screen and then come back to see your edits.
Expand Down
6 changes: 6 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,10 @@ dependencies {
} else {
implementation jscFlavor
}
// maven {
// url("https://maven.fpregistry.io/releases")
// }
// maven {
// url("https://www.jitpack.io")
// }
}
14 changes: 14 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ buildscript {
repositories {
google()
mavenCentral()
// maven {
// url("https://maven.fpregistry.io/releases")
// }
// maven {
// url("https://www.jitpack.io")
// }
}
dependencies {
classpath("com.android.tools.build:gradle")
Expand All @@ -18,4 +24,12 @@ buildscript {
}
}

allprojects {
repositories {
google()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven.fpregistry.io/releases' }
}
}

apply plugin: "com.facebook.react.rootproject"
27 changes: 26 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,30 @@
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import {
FingerprintJsProProvider
} from '@fingerprintjs/fingerprintjs-pro-react-native';

AppRegistry.registerComponent(appName, () => App);
const WrappedApp = () => (
<FingerprintJsProProvider
apiKey={'X876qE3W4DAYxlqO7sE4'}
// endpointUrl={'https://metrics.melissamoyerp.com'}
>
<App />
</FingerprintJsProProvider>
);

AppRegistry.registerComponent(appName, () => WrappedApp);


//AppRegistry.registerComponent(
// 'AppName',
// <FingerprintJsProProvider
// apiKey={'X876qE3W4DAYxlqO7sE4'}
// >
// <App />
// </FingerprintJsProProvider>
//);e


//AppRegistry.registerComponent(appName, () => App);
Loading