Languages

Menu
Sites
Language
Vibration in background

Hello.

When app open

if(settings_vibro == 1)
	navigator.vibrate(2000);
						
if(settings_sounds == 1)
	audioElement.play();

works vibration and sound

but when app in background, works only audio

how to make that the vibration worked in background?

Responses

10 Replies
Lakshmi Grandhi

Hi,

I have raise in JIRA https://bugs.tizen.org/jira/browse/TDIST-627, kindly follow it for more updates.

Alex Dem

Hi,
Just FYI:
For Native apps vibrator works for both cases (foreground and background).
Alexey.

Fedor Efimenko

vibration problem with notifications:

var notificationDict = {
    	              content : banner_content,
		              vibration : true, 
		              appControl : appControl,
		              appId : myappInfo.id,
		              iconPath : "/opt/apps/QUq5VDt2Zc/res/wgt/icon.png"};
		

why doesn't vibrate?

Raghavendra Reddy Shiva

Vibration works, even when the web app is sent to background.

Have quickly tested with below code (20 secs vibration).

function singleVibration()
{
   /* Vibrate for 20 seconds */
   navigator.vibrate(20000);
}

Fujikawa

On Samsung Gear 2 actual device, I tried background vibration and found it doesn't work, either.

Anyone know the solution?

Gökhan Kurt

Try turning screen on with tizen.power.turnScreenOn(); and then vibrate. Even try delaying time between screenon and vibrate.

Fujikawa

Vibration in background is not possible but you can make app active by using alarm api.

https://developer.tizen.org/documentation/articles/alarm-api-guide?langswitch=en

Stefano Accorsi

My app has and alarm defined that, when triggered, turns screen on and do a long navigator.vibrate. Some users reports that vibration works only while screen is on. The screen turns off and vibration stops. The user turn on again the screen, and the app (that is not in backgraound!) starts vibrate again.

I never experienced this issue ... at least until I updated SDK. Now, in my Gear2Neo, I've got the same problem. How's it possible? Something has changed in SDK? But some users reported this issue months ago, when I compiled the app with the previous SDK.

Is there a way to keep the screen always on while vibration is active?

Thank you.

Maciej

You can control screen state with tizen.power.request calls:

 

tizen.power.turnScreenOn(); //turn screen on
tizen.power.request("SCREEN", "SCREEN_DIM"); //keep the screen at least dimmed for undefinite time
tizen.power.request("SCREEN", "SCREEN_NORMAL"); //keep the screen at least in normal state
tizen.power.release("SCREEN"); //release screen state

 

Remember about the priviledge:

 

<tizen:privilege name="http://tizen.org/privilege/power"/>

 

Cheers

Stefano Accorsi

Thank you Mariej this was exactly what I needed!