Skip to content
Merged
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
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,18 @@ GH_TOKEN=
APP_VERSION=
BUILD_NUMBER=
BUILD_DATE=

# Google-Services.JSON
GOOGLE_SERVICES_JSON_BASE64=

# Expo LAN IP + Port
REACT_NATIVE_PACKAGER_HOSTNAME=192.168.68.63
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env.example includes a specific LAN IP for REACT_NATIVE_PACKAGER_HOSTNAME. Keeping a machine-specific address in an example file is likely to break other developers’ setups if copied verbatim; use a placeholder value (or omit it and document when/why to set it).

Suggested change
REACT_NATIVE_PACKAGER_HOSTNAME=192.168.68.63
# Set this to your machine's LAN IP when needed for React Native packager (e.g. 192.168.x.x)
REACT_NATIVE_PACKAGER_HOSTNAME=

Copilot uses AI. Check for mistakes.
EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0

# Google Sign-In Development Client ID (with debug SHA-1)
GOOGLE_WEB_CLIENT_ID_DEV=


#DO NOT COMMIT THIS
SENTRY_AUTH_TOKEN=

886 changes: 518 additions & 368 deletions android/app/src/main/AndroidManifest.xml

Large diffs are not rendered by default.

763 changes: 434 additions & 329 deletions app.config.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions app/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export default function TabLayout() {
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="phone" color={color} />,
}}
/>
<Tabs.Screen
name="permissions"
options={{
title: 'Permissions',
tabBarIcon: ({ color }: { color: string }) => <TabBarIcon name="shield" color={color} />,
}}
/>
</Tabs>
);
}
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/camera-mic.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import CameraMicrophonePermissionDemo from '@/components/permissions/CameraMicrophonePermissionDemo';

export default function CameraMicScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Camera & Microphone" showBackButton />
<CameraMicrophonePermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/connectivity.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import BluetoothNearbyPermissionDemo from '@/components/permissions/BluetoothNearbyPermissionDemo';

export default function ConnectivityScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Bluetooth & Nearby" showBackButton />
<BluetoothNearbyPermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
60 changes: 60 additions & 0 deletions app/(tabs)/permissions/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { Link } from 'expo-router';
import React from 'react';
import { View, Text, StyleSheet, ScrollView, Pressable } from 'react-native';
import CustomHeader from '@/components/CustomHeader';

const routes = [
{ href: '/permissions/location', title: 'Location (foreground/background)' },
{ href: '/permissions/camera-mic', title: 'Camera & Microphone' },
{ href: '/permissions/notifications', title: 'Notifications' },
{ href: '/permissions/media-storage', title: 'Media Library' },
{ href: '/permissions/storage', title: 'Storage & File Access' },
{ href: '/permissions/telephony-sms', title: 'Telephony & SMS' },
{ href: '/permissions/connectivity', title: 'Bluetooth & Nearby' },
];

export default function PermissionsHub() {
return (
<View style={styles.container}>
<CustomHeader title="Permissions Hub" />
<ScrollView contentContainerStyle={styles.content}>
<Text style={styles.lead}>
Explore Android permission demos. Each link opens a focused screen that requests the associated runtime permissions and
performs a small capability check.
</Text>
{routes.map((route) => (
<View style={styles.card} key={route.href}>
<Text style={styles.cardTitle}>{route.title}</Text>
<Link href={route.href} asChild>
<Pressable style={styles.button}>
<Text style={styles.buttonText}>Open demo</Text>
</Pressable>
</Link>
</View>
))}
</ScrollView>
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
content: { padding: 16, gap: 12 },
lead: { color: '#ccc', fontSize: 14, lineHeight: 20, marginBottom: 6 },
card: {
backgroundColor: '#111',
padding: 16,
borderRadius: 10,
gap: 8,
borderWidth: 1,
borderColor: '#222',
},
cardTitle: { color: '#fff', fontSize: 16, fontWeight: '600' },
button: {
backgroundColor: '#1e88e5',
paddingVertical: 10,
borderRadius: 8,
alignItems: 'center',
},
buttonText: { color: '#fff', fontWeight: '600' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/location.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import LocationPermissionDemo from '@/components/permissions/LocationPermissionDemo';

export default function LocationScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Location permissions" showBackButton />
<LocationPermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/media-storage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import MediaLibraryPermissionDemo from '@/components/permissions/MediaLibraryPermissionDemo';

export default function MediaStorageScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Media Library" showBackButton />
<MediaLibraryPermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/notifications.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import NotificationsPermissionDemo from '@/components/permissions/NotificationsPermissionDemo';

export default function NotificationsScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Notifications" showBackButton />
<NotificationsPermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/storage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import StoragePermissionDemo from '@/components/permissions/StoragePermissionDemo';

export default function StorageScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Storage" showBackButton />
<StoragePermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
17 changes: 17 additions & 0 deletions app/(tabs)/permissions/telephony-sms.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import CustomHeader from '@/components/CustomHeader';
import TelephonySmsPermissionDemo from '@/components/permissions/TelephonySmsPermissionDemo';

export default function TelephonySmsScreen() {
return (
<View style={styles.container}>
<CustomHeader title="Telephony & SMS" showBackButton />
<TelephonySmsPermissionDemo />
</View>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
});
Binary file added assets/permissions-hub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions components/permissions/BluetoothNearbyPermissionDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { useState } from 'react';
import { View, Text, Button, StyleSheet, ScrollView, PermissionsAndroid, Platform } from 'react-native';

const REQUESTS = [
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE,
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.NEARBY_WIFI_DEVICES,
];

export default function BluetoothNearbyPermissionDemo() {
const [statuses, setStatuses] = useState<Record<string, string>>({});

const request = async () => {
if (Platform.OS !== 'android') {
setStatuses({ platform: 'Only relevant on Android' });
return;
}
const results = await PermissionsAndroid.requestMultiple(REQUESTS);
setStatuses(results);
};

return (
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
<Text style={styles.title}>Bluetooth & Nearby</Text>
<Text style={styles.copy}>
Requests BLUETOOTH_CONNECT / SCAN / ADVERTISE along with NEARBY_WIFI_DEVICES and fine location to showcase nearby device
discovery prerequisites.
</Text>
<Button title="Request nearby permissions" onPress={request} />
<View style={styles.statusBox}>
{Object.keys(statuses).length === 0 ? (
<Text style={styles.statusText}>No results yet</Text>
) : (
Object.entries(statuses).map(([key, value]) => (
<Text style={styles.statusText} key={key}>
{key.split('.').pop()}: {value}
</Text>
))
)}
</View>
</ScrollView>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
content: { padding: 16, gap: 12 },
title: { color: '#fff', fontSize: 18, fontWeight: '700' },
copy: { color: '#ccc', fontSize: 14, lineHeight: 20 },
statusBox: { backgroundColor: '#111', padding: 12, borderRadius: 8, marginTop: 12 },
statusText: { color: '#fff', marginBottom: 4 },
});
45 changes: 45 additions & 0 deletions components/permissions/CameraMicrophonePermissionDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { useState } from 'react';
import { View, Text, Button, StyleSheet, ScrollView } from 'react-native';
import { Camera } from 'expo-camera';

export default function CameraMicrophonePermissionDemo() {
const [cameraStatus, setCameraStatus] = useState<string>('unknown');
const [micStatus, setMicStatus] = useState<string>('unknown');
const [availableTypes, setAvailableTypes] = useState<string>('not queried');

const requestPermissions = async () => {
const camera = await Camera.requestCameraPermissionsAsync();
const mic = await Camera.requestMicrophonePermissionsAsync();
setCameraStatus(camera.status);
setMicStatus(mic.status);

if (camera.status === 'granted') {
const types = await Camera.getAvailableCameraTypesAsync();
setAvailableTypes(types.join(', ') || 'none reported');
}
};

return (
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
<Text style={styles.title}>Camera & Microphone</Text>
<Text style={styles.copy}>
Requests CAMERA and RECORD_AUDIO plus microphone access via expo-camera. Queries available camera types once granted.
</Text>
<Button title="Request camera & mic permissions" onPress={requestPermissions} />
<View style={styles.statusBox}>
<Text style={styles.statusText}>Camera: {cameraStatus}</Text>
<Text style={styles.statusText}>Microphone: {micStatus}</Text>
<Text style={styles.statusText}>Available cameras: {availableTypes}</Text>
</View>
</ScrollView>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
content: { padding: 16, gap: 12 },
title: { color: '#fff', fontSize: 18, fontWeight: '700' },
copy: { color: '#ccc', fontSize: 14, lineHeight: 20 },
statusBox: { backgroundColor: '#111', padding: 12, borderRadius: 8, marginTop: 12 },
statusText: { color: '#fff', marginBottom: 4 },
});
62 changes: 62 additions & 0 deletions components/permissions/LocationPermissionDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React, { useState } from 'react';
import { View, Text, Button, StyleSheet, ScrollView, Platform } from 'react-native';
import * as Location from 'expo-location';

export default function LocationPermissionDemo() {
const [status, setStatus] = useState<Location.PermissionStatus | null>(null);
const [backgroundStatus, setBackgroundStatus] = useState<Location.PermissionStatus | null>(null);
const [coords, setCoords] = useState<string>('');
const [error, setError] = useState<string>('');

const requestPermissions = async () => {
setError('');
const fg = await Location.requestForegroundPermissionsAsync();
setStatus(fg.status);

if (Platform.OS === 'android') {
const bg = await Location.requestBackgroundPermissionsAsync();
setBackgroundStatus(bg.status);
}
};

const fetchLocation = async () => {
try {
const loc = await Location.getCurrentPositionAsync({});
setCoords(`${loc.coords.latitude.toFixed(5)}, ${loc.coords.longitude.toFixed(5)}`);
} catch (e) {
setError(e instanceof Error ? e.message : String(e));
}
};

return (
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
<Text style={styles.title}>Location (foreground & background)</Text>
<Text style={styles.copy}>
Requests ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION and demonstrates fetching a single
location fix via expo-location.
</Text>

<Button title="Request location permissions" onPress={requestPermissions} />
<View style={styles.gap} />
<Button title="Fetch current location" onPress={fetchLocation} />

<View style={styles.statusBox}>
<Text style={styles.statusText}>Foreground: {status ?? 'unknown'}</Text>
{Platform.OS === 'android' && <Text style={styles.statusText}>Background: {backgroundStatus ?? 'unknown'}</Text>}
{coords ? <Text style={styles.statusText}>Last fix: {coords}</Text> : null}
{error ? <Text style={[styles.statusText, styles.error]}>{error}</Text> : null}
</View>
</ScrollView>
);
}

const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#000' },
content: { padding: 16, gap: 12 },
title: { color: '#fff', fontSize: 18, fontWeight: '700' },
copy: { color: '#ccc', fontSize: 14, lineHeight: 20 },
statusBox: { backgroundColor: '#111', padding: 12, borderRadius: 8, marginTop: 12 },
statusText: { color: '#fff', marginBottom: 4 },
error: { color: '#ff6b6b' },
gap: { height: 10 },
});
Loading