Skip to main content
Version: v3

stop

Start from API_LEVEL 3.0 . Please refer to API_LEVEL.

Shutdown the specified backend service, called asynchronously, with the shutdown result returned via a callback function.

info

permission code: device:os.bg_service

Type

function stop(option: Option): Result

Parameters

Option

PropertyTypeRequiredDefaultValueDescriptionAPI_LEVEL
filestringY-The App Service js file must be the one configured in the service module in app.json3.0
complete_func(callbackOption: CallbackOption) => voidY-Callback function for the completion of the backend service stop3.0

CallbackOption

PropertyTypeDescriptionAPI_LEVEL
filestringApp service js file, same as stop incoming parameters3.0
resultbooleanApp service stop result, true means success, false means failure3.0

Result

TypeDescription
booleanIf 0 is returned, The App Service is closed successfully

Example

import { stop } from '@zos/app-service'