working
This commit is contained in:
3
app.json
3
app.json
@@ -8,7 +8,8 @@
|
||||
"scheme": "ugrat",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"ios": {
|
||||
"icon": "./assets/expo.icon"
|
||||
"icon": "./assets/expo.icon",
|
||||
"bundleIdentifier": "com.nurmuhammet.ali.ugrat"
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
|
||||
@@ -4,7 +4,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { Stack, router } from 'expo-router';
|
||||
import { useKeepAwake } from 'expo-keep-awake';
|
||||
import io from 'socket.io-client';
|
||||
import SendDirectSms from 'react-native-send-direct-sms';
|
||||
import { SendDirectSms } from 'react-native-send-direct-sms';
|
||||
|
||||
export default function DashboardScreen() {
|
||||
useKeepAwake(); // Keep the screen awake
|
||||
@@ -108,7 +108,7 @@ export default function DashboardScreen() {
|
||||
const targetPhone = data.phone || '+993 61 92 92 48';
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
SendDirectSms.sendDirectSms(targetPhone, data.message)
|
||||
SendDirectSms(targetPhone, data.message)
|
||||
.then((res: any) => {
|
||||
addLog(`SMS sent successfully to ${targetPhone}`);
|
||||
socket.emit('sms_status', { id: data.id, status: 'sent' });
|
||||
@@ -157,7 +157,12 @@ export default function DashboardScreen() {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={styles.logHeader}>
|
||||
<Text style={styles.logTitle}>Activity Log</Text>
|
||||
<TouchableOpacity onPress={() => setLogs([])} style={styles.clearButton}>
|
||||
<Text style={styles.clearButtonText}>Clear</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<FlatList
|
||||
data={logs}
|
||||
keyExtractor={item => item.id}
|
||||
@@ -222,11 +227,24 @@ const styles = StyleSheet.create({
|
||||
color: '#333',
|
||||
fontWeight: '600',
|
||||
},
|
||||
logHeader: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
paddingRight: 15,
|
||||
marginBottom: 10,
|
||||
},
|
||||
clearButton: {
|
||||
padding: 5,
|
||||
},
|
||||
clearButtonText: {
|
||||
color: '#208AEF',
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
logTitle: {
|
||||
fontSize: 18,
|
||||
fontWeight: 'bold',
|
||||
marginLeft: 15,
|
||||
marginBottom: 10,
|
||||
color: '#333',
|
||||
},
|
||||
logList: {
|
||||
|
||||
Reference in New Issue
Block a user