Languages

Menu
Sites
Language
백그라운드 상태인 앱을 API를 이용해서 포어그라운드로 전환하는 방법에 대한 문의

foreground  상태인 웹앱을 background로 전환하려면

해당 링크의 Aplication API의 hide 메소드를 이용하면 되는데

https://developer.tizen.org/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/2.3.1/org.tizen.web.apireference/html/device_api/wearable/tizen/application.html#Application::hide

 

반대로

background 상태인 웹앱을 foreground 로 전환하는 방법은 없나요?

Responses

1 Replies
Armaan-Ul- Islam

Hello,

From my understanding you are looking for a way to take your app to foreground from background. Based on that my reply would be following:

1. Find your application id from your config.xml file

<tizen:application id="yourpackage.yourapp" package="yourpackage" required_version="2.3.1"/>

2 . The 'application.launch' privilege will allow you to perform an application launch (from background to foreground) . 'background-support' allows your app to keep running in the background. So, Add these necessary priviledges to your config.xml

<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:setting background-support="enable" encryption="disable" hwkey-event="enable"/>

3. Use the tizen.application.launch command to take your app from background to foreground. Use your app id (above) as argument of the function.

tizen.application.launch("yourpackage.yourapp", onsuccess);

function onsuccess() {
console.log("Application back to Foreground successfully");
}

Thank you.