Skip to content

Commit 45b4793

Browse files
Merge pull request #9 from codebuilderinc/copilot/add-all-permissions-to-app
Request all platform permissions and add Android permission demos for CodeBuilder Admin
2 parents 9512cf9 + 2cbbfa5 commit 45b4793

20 files changed

+1524
-697
lines changed

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,18 @@ GH_TOKEN=
3030
APP_VERSION=
3131
BUILD_NUMBER=
3232
BUILD_DATE=
33+
34+
# Google-Services.JSON
35+
GOOGLE_SERVICES_JSON_BASE64=
36+
37+
# Expo LAN IP + Port
38+
REACT_NATIVE_PACKAGER_HOSTNAME=192.168.68.63
39+
EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0
40+
41+
# Google Sign-In Development Client ID (with debug SHA-1)
42+
GOOGLE_WEB_CLIENT_ID_DEV=
43+
44+
45+
#DO NOT COMMIT THIS
46+
SENTRY_AUTH_TOKEN=
47+

android/app/src/main/AndroidManifest.xml

Lines changed: 518 additions & 368 deletions
Large diffs are not rendered by default.

app.config.js

Lines changed: 434 additions & 329 deletions
Large diffs are not rendered by default.

app/(tabs)/_layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ export default function TabLayout() {
4444
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="phone" color={color} />,
4545
}}
4646
/>
47+
<Tabs.Screen
48+
name="permissions"
49+
options={{
50+
title: 'Permissions',
51+
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="shield" color={color} />,
52+
}}
53+
/>
4754
</Tabs>
4855
);
4956
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import CustomHeader from '@/components/CustomHeader';
4+
import CameraMicrophonePermissionDemo from '@/components/permissions/CameraMicrophonePermissionDemo';
5+
6+
export default function CameraMicScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<CustomHeader title="Camera & Microphone" showBackButton />
10+
<CameraMicrophonePermissionDemo />
11+
</View>
12+
);
13+
}
14+
15+
const styles = StyleSheet.create({
16+
container: { flex: 1, backgroundColor: '#000' },
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import CustomHeader from '@/components/CustomHeader';
4+
import BluetoothNearbyPermissionDemo from '@/components/permissions/BluetoothNearbyPermissionDemo';
5+
6+
export default function ConnectivityScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<CustomHeader title="Bluetooth & Nearby" showBackButton />
10+
<BluetoothNearbyPermissionDemo />
11+
</View>
12+
);
13+
}
14+
15+
const styles = StyleSheet.create({
16+
container: { flex: 1, backgroundColor: '#000' },
17+
});

app/(tabs)/permissions/index.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { Link } from 'expo-router';
2+
import React from 'react';
3+
import { View, Text, StyleSheet, ScrollView, Pressable } from 'react-native';
4+
import CustomHeader from '@/components/CustomHeader';
5+
6+
const routes = [
7+
{ href: '/permissions/location', title: 'Location (foreground/background)' },
8+
{ href: '/permissions/camera-mic', title: 'Camera & Microphone' },
9+
{ href: '/permissions/notifications', title: 'Notifications' },
10+
{ href: '/permissions/media-storage', title: 'Media Library' },
11+
{ href: '/permissions/storage', title: 'Storage & File Access' },
12+
{ href: '/permissions/telephony-sms', title: 'Telephony & SMS' },
13+
{ href: '/permissions/connectivity', title: 'Bluetooth & Nearby' },
14+
];
15+
16+
export default function PermissionsHub() {
17+
return (
18+
<View style={styles.container}>
19+
<CustomHeader title="Permissions Hub" />
20+
<ScrollView contentContainerStyle={styles.content}>
21+
<Text style={styles.lead}>
22+
Explore Android permission demos. Each link opens a focused screen that requests the associated runtime permissions and
23+
performs a small capability check.
24+
</Text>
25+
{routes.map((route) => (
26+
<View style={styles.card} key={route.href}>
27+
<Text style={styles.cardTitle}>{route.title}</Text>
28+
<Link href={route.href} asChild>
29+
<Pressable style={styles.button}>
30+
<Text style={styles.buttonText}>Open demo</Text>
31+
</Pressable>
32+
</Link>
33+
</View>
34+
))}
35+
</ScrollView>
36+
</View>
37+
);
38+
}
39+
40+
const styles = StyleSheet.create({
41+
container: { flex: 1, backgroundColor: '#000' },
42+
content: { padding: 16, gap: 12 },
43+
lead: { color: '#ccc', fontSize: 14, lineHeight: 20, marginBottom: 6 },
44+
card: {
45+
backgroundColor: '#111',
46+
padding: 16,
47+
borderRadius: 10,
48+
gap: 8,
49+
borderWidth: 1,
50+
borderColor: '#222',
51+
},
52+
cardTitle: { color: '#fff', fontSize: 16, fontWeight: '600' },
53+
button: {
54+
backgroundColor: '#1e88e5',
55+
paddingVertical: 10,
56+
borderRadius: 8,
57+
alignItems: 'center',
58+
},
59+
buttonText: { color: '#fff', fontWeight: '600' },
60+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import CustomHeader from '@/components/CustomHeader';
4+
import LocationPermissionDemo from '@/components/permissions/LocationPermissionDemo';
5+
6+
export default function LocationScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<CustomHeader title="Location permissions" showBackButton />
10+
<LocationPermissionDemo />
11+
</View>
12+
);
13+
}
14+
15+
const styles = StyleSheet.create({
16+
container: { flex: 1, backgroundColor: '#000' },
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import CustomHeader from '@/components/CustomHeader';
4+
import MediaLibraryPermissionDemo from '@/components/permissions/MediaLibraryPermissionDemo';
5+
6+
export default function MediaStorageScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<CustomHeader title="Media Library" showBackButton />
10+
<MediaLibraryPermissionDemo />
11+
</View>
12+
);
13+
}
14+
15+
const styles = StyleSheet.create({
16+
container: { flex: 1, backgroundColor: '#000' },
17+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { View, StyleSheet } from 'react-native';
3+
import CustomHeader from '@/components/CustomHeader';
4+
import NotificationsPermissionDemo from '@/components/permissions/NotificationsPermissionDemo';
5+
6+
export default function NotificationsScreen() {
7+
return (
8+
<View style={styles.container}>
9+
<CustomHeader title="Notifications" showBackButton />
10+
<NotificationsPermissionDemo />
11+
</View>
12+
);
13+
}
14+
15+
const styles = StyleSheet.create({
16+
container: { flex: 1, backgroundColor: '#000' },
17+
});

0 commit comments

Comments
 (0)