import React from 'react'; import { TouchableWithoutFeedback, View, Text, Alert } from 'react-native'; const MyButton = () => { const handleLongPress = () => { // Obsługa przytrzymania guzika Alert.alert('Button Long Pressed', 'You long pressed the button'); }; const handlePress = () => { // Obsługa zwykłego kliknięcia guzika fetch('https://wol.turtel.xyz/wolweb/wake/pajonk') .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }) .then(data => { console.log(data); Alert.alert('Response', JSON.stringify(data)); }) .catch(error => { console.error('There was a problem with the fetch operation:', error); Alert.alert('Error', 'There was a problem with the request'); }); }; return ( Send Request ); }; export default MyButton;