From 2679f22046cfe1c187fbabacf1c625fbd1d6142f Mon Sep 17 00:00:00 2001 From: tjanderson3 Date: Sun, 11 Feb 2024 18:07:54 -0500 Subject: [PATCH 1/2] f --- screens/Alarm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/screens/Alarm.js b/screens/Alarm.js index 4b872d3..30254b8 100644 --- a/screens/Alarm.js +++ b/screens/Alarm.js @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import DateTimePickerModal from 'react-native-modal-datetime-picker'; +import * as SMS from 'expo-sms'; import { textStyles, styles } from '../styles/styles'; function AlarmClock() { From cea3634433f056b61083da8e064f1fb1b4482787 Mon Sep 17 00:00:00 2001 From: tjanderson3 Date: Sun, 11 Feb 2024 20:25:29 -0500 Subject: [PATCH 2/2] f --- screens/Alarm.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/screens/Alarm.js b/screens/Alarm.js index 30254b8..c38f44d 100644 --- a/screens/Alarm.js +++ b/screens/Alarm.js @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import DateTimePickerModal from 'react-native-modal-datetime-picker'; +// eslint-disable-next-line import/no-extraneous-dependencies import * as SMS from 'expo-sms'; import { textStyles, styles } from '../styles/styles'; @@ -29,6 +30,7 @@ function AlarmClock() { alert('Wake up!'); setIsAlarmSet(false); setCountdown(''); + // sendAlarmNotification();--> Need to implement feature in settings that takes phone number input }, timeUntilAlarm); // Start updating the countdown every second @@ -48,6 +50,12 @@ function AlarmClock() { hideDatePicker(); }; + const sendAlarmNotification = async (phoneNumber) => { + const isAvailable = await SMS.isAvailableAsync(); + if (isAvailable) { + await SMS.sendSMSAsync(phoneNumber, 'Alarm missed! Wake up!'); + } + }; return (