0

Is it possible to utilize button-hold on mobile phone as a trigger for some programmed action? E.g. my app runs in background and it is programmed to open up if I hold both volume up and volume down buttons for 3 seconds.

I want to make iPhone/Android app. I haven't choose any framework yet, it's a question of technical possibility of such an idea, but I'll probably use objective-C/Swift as I have an iPhone.

Paweł J
  • 33
  • 1
  • 10
  • 1
    What tools are you working with? If you're making an android/iphone app, yes. If you're making a web app, theoretically no. Can you specify the use case a bit more? It's really hard to go on what you've given us. – Jordan Lagan Jul 13 '20 at 15:46
  • Thank you, I didn't think of web app, but you're right, that the question wasn't clear enough. I've just edited it. Could you answer how do one do that for a android/iphone app? I'm not using any tools yet. – Paweł J Jul 13 '20 at 15:50

1 Answers1

0

I found an information for iOS on how to use events from volume buttons here, however it seems to be impossible to use events from power button or home button in the background, except from noticing that the app went from foreground to the background at home/power-button action.

Paweł J
  • 33
  • 1
  • 10