I've written an app and I want to create a 5 second delay between trying to program a door lock with setCode
. The problem is that I want the action to be synchronous, not scheduled. So the logic goes like this:
- Set door lock with code
- Wait 5 seconds - This is where I'm having trouble. I don't see how
runIn()
helps with this. - Check if code was successfully programmed / detected - If success - send Success push notification
- If not, repeat above sequence
- If all attempts are exhausted - send Failure push notification
Any suggestions?