[+] Check if accelerometer is available

This commit is contained in:
Hykilpikonna
2021-01-27 18:30:08 -05:00
parent 2313b3cded
commit 7089e480ae
@@ -87,8 +87,16 @@ class AlarmActivationViewController: UIViewController
*/
func runAlarm()
{
// Check if the device has accelerometer
var wvm = currentAlarm.wakeMethod.name
if wvm == "Shake" && !motion.isAccelerometerAvailable
{
msg("Error", "Accelerometer is not available on your device, so shaking your phone wouldn't work.")
wvm = "Factor"
}
switch currentAlarm.wakeMethod.name
// Initialize alarm
switch wvm
{
case "Factor":
initFactorProblem()