-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
40 lines (34 loc) · 1017 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { StyleSheet, Text, View, Button, StatusBar } from "react-native";
import Braze from "@braze/react-native-sdk";
import { useEffect, useState } from "react";
const userId = "{YOUR_USER_ID}";
/**
* Status bar modification.
* We seem to be experiencing the issue only when the status bar is translucent.
*/
StatusBar.setTranslucent(true);
StatusBar.setBarStyle("dark-content", false);
StatusBar.setBackgroundColor("deeppink");
export default function App() {
const [userId, setUserId] = useState(null);
useEffect(() => {
if (userId) {
Braze.changeUser(userId);
}
}, [userId]);
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Button onPress={() => setUserId(USER_ID)} title="Set user ID" />
<Text>{userId ?? "No user ID set"}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "pink",
alignItems: "center",
justifyContent: "center",
},
});