-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.js
More file actions
70 lines (65 loc) · 1.71 KB
/
Copy pathApp.js
File metadata and controls
70 lines (65 loc) · 1.71 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
65
66
67
68
69
70
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { useEffect, useState } from 'react';
import { getSystemInfo } from '@fluidinference/react-native-fluidaudio';
export default function App() {
const [status, setStatus] = useState('Loading...');
const [info, setInfo] = useState(null);
useEffect(() => {
async function test() {
try {
setStatus('Calling getSystemInfo...');
const result = await getSystemInfo();
setInfo(result);
setStatus('Success!');
} catch (error) {
setStatus(`Error: ${error.message}`);
console.error('FluidAudio error:', error);
}
}
test();
}, []);
return (
<View style={styles.container}>
<Text style={styles.title}>FluidAudio Expo Test</Text>
<Text style={styles.status}>{status}</Text>
{info && (
<View style={styles.infoBox}>
<Text style={styles.infoText}>Platform: {info.platform}</Text>
<Text style={styles.infoText}>Apple Silicon: {info.isAppleSilicon ? 'Yes' : 'No'}</Text>
<Text style={styles.infoText}>Summary: {info.summary}</Text>
</View>
)}
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
padding: 20,
},
title: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 20,
},
status: {
fontSize: 16,
color: '#666',
marginBottom: 20,
textAlign: 'center',
},
infoBox: {
backgroundColor: '#f0f0f0',
padding: 20,
borderRadius: 10,
},
infoText: {
fontSize: 14,
marginBottom: 5,
},
});