2023-09-22 14:46:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
2024-03-19 02:32:31 +00:00
|
|
|
* @file Provides the capability to manage OAID
|
2024-01-08 07:25:39 +00:00
|
|
|
* @kit AdsKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2023-09-22 23:52:21 +00:00
|
|
|
import type { AsyncCallback } from './@ohos.base';
|
2023-09-22 14:46:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides the capability to manage OAID.
|
|
|
|
* @namespace identifier
|
|
|
|
* @syscap SystemCapability.Advertising.OAID
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
declare namespace identifier {
|
|
|
|
/**
|
|
|
|
* Obtain the OAID with callback.
|
2023-11-14 11:24:52 +00:00
|
|
|
* Obtaining OAID requires the permission:ohos.permission.APP_TRACKING_CONSENT, otherwise the obtained OAID is 00000000-0000-0000-0000-000000000000.
|
2023-09-22 14:46:22 +00:00
|
|
|
* @permission ohos.permission.APP_TRACKING_CONSENT
|
|
|
|
* @param { AsyncCallback<string> } callback - The callback to get the OAID.
|
|
|
|
* @throws { BusinessError } 17300001 - System internal error.
|
|
|
|
* @syscap SystemCapability.Advertising.OAID
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function getOAID(callback: AsyncCallback<string>): void;
|
|
|
|
|
|
|
|
/**
|
2023-11-14 11:24:52 +00:00
|
|
|
* Obtain the OAID with promise.
|
2024-01-08 12:03:07 +00:00
|
|
|
* Obtaining OAID requires the permission:ohos.permission.APP_TRACKING_CONSENT, otherwise the obtained OAID is 00000000-0000-0000-0000-000000000000.
|
2023-09-22 14:46:22 +00:00
|
|
|
* @permission ohos.permission.APP_TRACKING_CONSENT
|
2023-11-14 11:24:52 +00:00
|
|
|
* @returns { Promise<string> } promise - Returns the OAID.
|
2023-09-22 14:46:22 +00:00
|
|
|
* @throws { BusinessError } 17300001 - System internal error.
|
|
|
|
* @syscap SystemCapability.Advertising.OAID
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
function getOAID(): Promise<string>;
|
|
|
|
|
2024-06-18 07:38:37 +00:00
|
|
|
/**
|
|
|
|
* Reset the OAID.
|
|
|
|
* A new OAID will be generated after reset.
|
|
|
|
* @throws { BusinessError } 17300001 - System internal error.
|
|
|
|
* @syscap SystemCapability.Advertising.OAID
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-09-22 14:46:22 +00:00
|
|
|
/**
|
|
|
|
* Reset the OAID.
|
|
|
|
* A new OAID will be generated after reset.
|
2024-06-18 09:03:05 +00:00
|
|
|
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
|
2023-09-22 14:46:22 +00:00
|
|
|
* @throws { BusinessError } 17300001 - System internal error.
|
2024-06-18 09:03:05 +00:00
|
|
|
* @throws { BusinessError } 17300002 - Not in the trust list.
|
2023-09-22 14:46:22 +00:00
|
|
|
* @syscap SystemCapability.Advertising.OAID
|
|
|
|
* @systemapi
|
2024-06-18 07:38:37 +00:00
|
|
|
* @since 12
|
2023-09-22 14:46:22 +00:00
|
|
|
*/
|
2023-09-22 23:52:21 +00:00
|
|
|
function resetOAID(): void;
|
2023-09-22 14:46:22 +00:00
|
|
|
}
|
|
|
|
export default identifier;
|
|
|
|
|