• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# FullScreenLaunchComponent
2
3
4**FullScreenLaunchComponent** is a component designed for launching atomic services in full screen. If the invoked application (the one being launched) grants the invoker the authorization to run the atomic service in an embedded manner, the invoker can operate the atomic service in full-screen embedded mode. If authorization is not provided, the invoker will launch the atomic service in a pop-up manner.
5
6
7> **NOTE**
8>
9> This component is supported since API version 12. Updates will be marked with a superscript to indicate their earliest API version.
10>
11> To implement an embeddable atomic service within this component, it must inherit from [EmbeddableUIAbility](../../apis-ability-kit/js-apis-app-ability-embeddableUIAbility.md). If it does not inherit from **EmbeddableUIAbility**, the system cannot guarantee that the atomic service will function properly.
12
13
14## Modules to Import
15
16```ts
17import { FullScreenLaunchComponent } from '@kit.ArkUI'
18```
19
20
21## Child Components
22
23Not supported
24
25## Attributes
26The [universal attributes](ts-component-general-attributes.md) are not supported.
27
28## Events
29The [universal events](ts-component-general-events.md) are not supported.
30
31## FullScreenLaunchComponent
32
33FullScreenLaunchComponent({ content: Callback\<void>, appId: string, options?: AtomicServiceOptions, onError?: ErrorCallback, onTerminated?: Callback\<TerminationInfo> })
34
35**Decorator**: \@Component
36
37**System capability**: SystemCapability.ArkUI.ArkUI.Full
38
39| Name| Type| Mandatory| Decorator Type| Description|
40| -------- | -------- | -------- | -------- | -------- |
41| content | Callback\<void> | Yes| \@BuilderParam | Custom placeholder icon displayed before launching the atomic service. This allows you to create a large launch icon similar to those used by desktop applications. Clicking the placeholder icon will launch the atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
42| appId | string | Yes| - |  Application ID of the atomic service to be launched. It is the unique identifier for the atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 12.<!--RP1--><!--RP1End-->|
43| options | [AtomicServiceOptions](../../apis-ability-kit/js-apis-app-ability-atomicServiceOptions.md) | No| - | Parameters for launching the atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
44| onError<sup>18+<sup> | [ErrorCallback](../../apis-basic-services-kit/js-apis-base.md#errorcallback) | No| - | Triggered when an exception occurs during the execution of an embedded atomic service. You can obtain the error information based on the **code**, **name**, and **message** parameters in the callback and rectify the exception accordingly.<br>**Atomic service API**: This API can be used in atomic services since API version 18.|
45| onTerminated<sup>18+<sup> | [Callback](../../apis-basic-services-kit/js-apis-base.md#callback)\<[TerminationInfo](ts-container-embedded-component.md#terminationinfo)> | No| - | Triggered when an embedded atomic service exits properly by calling [terminateSelfWithResult](../../apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateselfwithresult) or [terminateSelf](../../apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateself).<br>**Atomic service API**: This API can be used in atomic services since API version 18.|
46
47> **NOTE**
48>
49> - If the atomic service exits by calling [terminateSelfWithResult](../../apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateselfwithresult), the information it carries is passed to the callback parameter.
50> - If the atomic service exits by calling [terminateSelf](../../apis-ability-kit/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateself), the callback parameter has a default **code** value of **0** and **want** of **undefined**.
51
52## Example
53
54```ts
55import { FullScreenLaunchComponent } from '@kit.ArkUI';
56
57@Entry
58@Component
59struct Index {
60  @State appId: string = '6918661953712445909'; // Application ID of the atomic service.
61
62  build() {
63    Row() {
64      Column() {
65        FullScreenLaunchComponent({
66          content: ColumChild,
67          appId: this.appId,
68          options: {},
69          onTerminated: (info) => {
70            console.info("onTerminated code: " + info.code.toString());
71          },
72          onError: (err) => {
73            console.error("onError code: " + err.code + ", message: ", err.message);
74          }
75        }).width("80vp").height("80vp")
76      }
77      .width('100%')
78    }
79    .height('100%')
80  }
81}
82
83@Builder
84function ColumChild() {
85  Column() {
86    Image($r('app.media.icon'))
87    Text('test')
88  }
89}
90```
91