# Can't terminate web-hosted app

**URL:** <https://forum.webosose.org/t/cant-terminate-web-hosted-app/1822>\
**Category:** App Development\
**Created:** [August 6, 2022, 8:12pm UTC](https://forum.webosose.org/t/cant-terminate-web-hosted-app/1822 "2022-08-06T20:12:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raymag](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/raymag/32/688_2.png) [@raymag](https://forum.webosose.org/u/raymag)\
**Post date:** [August 6, 2022, 8:12pm UTC](https://forum.webosose.org/t/cant-terminate-web-hosted-app/1822/1 "2022-08-06T20:12:40Z")

</div>

So I'm building an web-hosted app with react for WebOS. I need to terminate the app after the user clicks on a specific button. But the problem is I can't manage to close the application by making a request call to the applicationManager. Everytime I try to I get an denied response.

Here's how I'm trying to terminate it:

```auto
webOS.service.request('luna://com.webos.applicationManager', {
    method: 'closeByAppId',
    parameters: { id: TV_APP_ID },
    onSuccess(response) {
      if (response.returnValue === false) {
        console.error(
          `Error sending Application to background and bringing TV Application with ID ${TV_APP_ID} to the foreground.`
        );
      }
      console.log('success');
    },
    onFailure(error) {
        alert(error)
        console.log(error)
    },
  })

```

and the response I always get it:

```auto
{returnValue: false, errorCode: -1, errorText: "Denied method call "closeByAppId" for category "/dev""}

```

Does anyone know where am I messing things here?

---

<div class="post-metadata">

**Author:** ![NERGI](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/nergi/32/364_2.png) [@NERGI](https://forum.webosose.org/u/NERGI)\
**Post date:** [August 8, 2022, 2:25am UTC](https://forum.webosose.org/t/cant-terminate-web-hosted-app/1822/2 "2022-08-08T02:25:54Z")

</div>

Hi @raymag , welcome to the forum.

What is your webOS platform? TV or OSE?  
This forum only for webOS Open Source Edition.  
For webOS TV, please visit the [TV Forum](https://developer.lge.com/community/forums/RetrieveForumList.dev?prodTypeCode=TV).

Thanks
