Countdown counter

Can someone please help me with this?

Hi, what’s your problem more specifically? I’m assuming you have something like this:

You can put a web URL or a local filesystem path as input to the “Play audio” flow.

However if your app is completely offline, I don’t know if you’ll be able to include the audio files. Even if you’re using a local path in the flow function, you’ll have to download the audio to the device first.

Yes, I have exactly the same logic, but it does not work!

You need to create a true/false type app variable called “vibrate” for the formula to work, and then you need to let the user change the value of that app variable to true or false somewhere (for example bound to a Toggle component), so they can decide whether they want the vibration or audio :slight_smile:

Thanks Mari, now works with vibration.
How do I get users to choose whether they want vibration or audio?
I created a Toggle component and then …?

Bind the toggle value to appVars.vibrate :slight_smile: if you want the choice to be saved you can use “Set item to storage” and “Get item from storage” for that.

Thank you Mari for your answers.
Sorry to say :frowning: that it is very difficult for someone who is new to writing apps to understand your instructions!
Can you please explain a little more with Screenshot and what the logic should look like?

Hi @user25 sorry if I was too brief, here’s a tutorial:

  1. Create a true/false app variable silentMode and bind it to a toggle list item:

  2. Use “Receive event” to listen to when the app variable changes. Save item with silentMode to storage with either “on” or “off” as the value:


  3. On Global Canvas when app launches, check for the value of silentMode and set the app variable accordingly. The formula used here is IF(outputs["Get item from storage"].item === "on", true, false)

Thank you so much Mari :slight_smile:
I test and get in touch!

1 Like

I did exactly as you said, but the vibration does not turn off from the toggle!

Hi, just use the silentMode app variable also in the button logic. :slight_smile:

When I use silentMode variable in the button logic, then the button is locked completely, and can not be clicked when toggle is “On”, and when toggle is “Off” the button works and vibration also works

Hi, that’s because you’ve bound the “Disabled” field to the app variable. A disabled button can’t be clicked, so when silentMode is true the user won’t be able to click the button anymore.

1 Like

Now it works as it should Mari :slight_smile:
I am very grateful for your help

1 Like

Great to hear :slight_smile: Happy to help!

1 Like