2 * Copyright (c) 2017 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace LibTVRefCommonPortable.Utils
22 /// A class provides App Control utility APIs.
24 public sealed class AppControlUtils
27 /// A method makes the package ID's app to be launched.
29 /// <param name="pkgID">A package ID of the targeted application.</param>
30 public static void SendLaunchRequest(string pkgID)
32 if (DependencyService.Get<IAppControl>() == null)
37 DependencyService.Get<IAppControl>().SendLaunchRequest(pkgID);
41 /// A method sends a add pin request App Control to TVApps app.
43 public static void SendAddAppRequestToApps()
45 if (DependencyService.Get<IAppControl>() == null)
50 DependencyService.Get<IAppControl>().SendAddAppRequestToApps();
54 /// A method sends a pin added notification App control to TVHome app.
56 /// <param name="addedAddID">A app ID of newly added.</param>
57 public static void SendAppAddedNotificationToHome(string addedAddID)
59 if (DependencyService.Get<IAppControl>() == null)
64 DependencyService.Get<IAppControl>().SendAppAddedNotificationToHome(addedAddID);
68 /// A method terminates caller application.
70 public static void SelfTerminate()
72 if (DependencyService.Get<IAppLifeControl>() == null)
77 DependencyService.Get<IAppLifeControl>().SelfTerminate();