-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOnboarding.tsx
More file actions
64 lines (55 loc) · 2.42 KB
/
Copy pathOnboarding.tsx
File metadata and controls
64 lines (55 loc) · 2.42 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Pressable, ScrollView, Text, View } from "react-native";
import { useAuth } from "../../auth";
import { colors, styles } from "../../styles";
export function Onboarding() {
const { markOnboardingCompleted } = useAuth();
// Just flip the flag — Navigation's conditional rendering switches to Tabs automatically.
const handleGetStarted = () => {
markOnboardingCompleted();
};
return (
<ScrollView
style={{ flex: 1, backgroundColor: colors.background }}
contentContainerStyle={styles.scrollContent}
>
<View style={styles.card}>
<Text style={styles.title}>Test Detour Links</Text>
<Text style={styles.subtitle}>
Add credentials from the Detour panel to <Text style={styles.accent}>.env</Text> before
testing.
</Text>
<View style={styles.divider} />
<Text style={styles.sectionHeader}>Universal / App Link</Text>
<Text style={styles.bullet}>
Open a <Text style={styles.accent}>godetour.link</Text> URL in the browser — Detour
resolves it and navigates to the Details screen.
</Text>
<Text style={styles.code}>https://<your-org>.godetour.link/<hash>/details</Text>
<Text style={styles.sectionHeader}>Custom Scheme</Text>
<Text style={styles.bullet}>
This example also handles custom scheme links. Opening a non-Detour URL redirects to the
Third-party screen. Test with the simulator:
</Text>
<Text style={styles.code}>
npx uri-scheme open {`"detour-react-navigation-advanced://app"`} --ios
</Text>
<Text style={styles.sectionHeader}>Deferred Link + Auth Gate</Text>
<Text style={styles.bullet}>
Copy a Detour link to your clipboard, sign out, then relaunch. The deferred link will
survive the sign-in flow — once you finish sign-in and onboarding, React Navigation
replays the link and lands you on Details automatically.
</Text>
<Text style={styles.bullet}>
Make sure <Text style={styles.accent}>Copy link feature enabled</Text> is turned on in App
Configuration in the Detour panel.
</Text>
</View>
<Pressable
onPress={handleGetStarted}
style={[styles.button, { alignSelf: "stretch", marginTop: 12 }]}
>
<Text style={styles.buttonText}>Get Started →</Text>
</Pressable>
</ScrollView>
);
}