From e8a0b488dc6cb5bb94061e455e96dd2d1c22bf52 Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Wed, 25 May 2016 18:36:12 -0700 Subject: [PATCH] docs: Remove Advertising ID page and redirect to GMS reference docs b/28965089 Change-Id: I16141cf5711358c1b38f7e28a8150e2281990eb6 --- docs/html/_redirects.yaml | 2 + docs/html/google/_book.yaml | 3 - docs/html/google/play-services/id.jd | 193 --------------------------- 3 files changed, 2 insertions(+), 196 deletions(-) delete mode 100644 docs/html/google/play-services/id.jd diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml index 4211c6fbd5ea0..42c88896c6c56 100644 --- a/docs/html/_redirects.yaml +++ b/docs/html/_redirects.yaml @@ -127,6 +127,8 @@ redirects: to: https://developers.google.com/mobile-ads-sdk/ - from: /google/play-services/wallet.html to: https://developers.google.com/wallet/instant-buy/ +- from: /google/play-services/id.html + to: https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient - from: /google/play/safetynet/... to: /training/safetynet/index.html - from: /google/gcm/... diff --git a/docs/html/google/_book.yaml b/docs/html/google/_book.yaml index 92357e9730c6a..885ad7a3a935c 100644 --- a/docs/html/google/_book.yaml +++ b/docs/html/google/_book.yaml @@ -63,9 +63,6 @@ toc: - title: Google Play Developer API path: /google/play/developer-api.html -- title: Advertising ID - path: /google/play-services/id.html - - title: Multiple APK Support path: /google/play/publishing/multiple-apks.html diff --git a/docs/html/google/play-services/id.jd b/docs/html/google/play-services/id.jd deleted file mode 100644 index 2f0664c4fed49..0000000000000 --- a/docs/html/google/play-services/id.jd +++ /dev/null @@ -1,193 +0,0 @@ -page.title=Advertising ID -page.tags=Ads,Advertising ID,ID - -@jd:body -
- -
-

- The advertising ID is a user-specific, unique, resettable ID for advertising, - provided by Google Play services. It gives users better controls and provides - developers with a simple, standard system to continue to monetize your apps. - It is an anonymous identifier for advertising purposes and enables users to - reset their identifier or opt out of interest-based ads within Google Play - apps. -

-

- The advertising ID is accessible through a straightforward API that you can - implement in your apps. For details, take a look at the overview and the - advertising ID API reference. -

-
-
-
- - -
-

- As a reminder, please note that starting 1 August 2014, new - apps and app updates distributed through Google Play must use the advertising - ID in lieu of any other persistent identifiers for any advertising purposes, - on devices that support the advertising ID.
-
- To learn how to check your app's compliance through the Developer Console, or - for details on the associated developer policy changes, please see the - Advertising - ID topic in the Google Play developer help center. -

-

Using the Advertising ID

-

- The advertising ID is a unique but - user-resettable string identifier that lets ad networks and other apps anonymously - identify a user. The user's advertising ID is made available to apps through APIs - provided in Google Play services. -

-

- Users can reset their advertising ID at any time, right from the Ads section of the - Google Settings app on their devices. From the same app, users can also - opt-out of targeted advertising based on the advertising ID by setting the appropriate - ad tracking preference. When the - user opts-out of targeted ads, this ad tracking preference is made available - to apps through a Google Play services API. -

-

- Apps making use of the advertising ID must check for and respect the - user's ad tracking preference. Also please note that any use of the advertising ID - must abide by the terms of the Google Play - Developer Content Policies. -

-

Format of the Advertising ID

-

- Google Play services APIs expose the user's advertising ID as a string format of UUID, - with values similar to this: -

-

"38400000-8cf0-11bd-b23e-10b96e40000d"

-

Requirements

- -

Obtaining the user's advertising ID and ad tracking preference

-

- If you want to use the advertising ID in your app, you must first install the Google - Play services SDK. As noted in the requirements above, you should install the - SDK for Google Play services 4.0 or higher if you will develop using the advertising ID - APIs. For information about how to get started, see Setting Up Google Play services. -

-

- The advertising ID APIs are available in the - com.google.android.gms.ads.identifier package in the Google - Play Services library. To obtain the user's advertising ID and tracking preference, - call the method - - getAdvertisingIdInfo(), which returns an - AdvertisingIdClient.Info encapsulating the user's current Advertising ID - and tracking preference. -

-

- Note: The - getAdvertisingIdInfo() - method is a blocking call, so you must not call it on the main (UI) thread. - If called on the main thread, the method throws - {@link java.lang.IllegalStateException}. -

-

- Once you've retrieved the - - AdvertisingIdClient.Info - object, you can use its - getId() and - isLimitAdTrackingEnabled() methods to access the advertising ID and - ad tracking preference. -

- - - - - - - - - - - - - -
MethodDescription
public String getId()Retrieves the advertising ID.
public boolean isLimitAdTrackingEnabled()Retrieves whether the user has limit ad tracking enabled or not.
-

- The advertising ID APIs do not include a "reset" method. Only users can initiate a - reset of their own advertising IDs, through the Google Settings application. -

-

- For more information about the advertising ID APIs, see the - reference documentation. -

-

Example implementation

-

- Here's a basic illustration of how you can retrieve the user's advertising ID and ad - tracking preference in your app: -

-
-import com.google.android.gms.ads.identifier.AdvertisingIdClient;
-import com.google.android.gms.ads.identifier.AdvertisingIdClient.Info;
-import com.google.android.gms.common.GooglePlayServicesAvailabilityException;
-import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
-import java.io.IOException;
-...
-// Do not call this function from the main thread. Otherwise,
-// an IllegalStateException will be thrown.
-public void getIdThread() {
-  Info adInfo = null;
-  try {
-    adInfo = AdvertisingIdClient.getAdvertisingIdInfo(mContext.getApplicationContext());
-  } catch (IOException e) {
-    // Unrecoverable error connecting to Google Play services (e.g.,
-    // the old version of the service doesn't support getting AdvertisingId).
-
-  } catch (GooglePlayServicesAvailabilityException e) {
-    // Encountered a recoverable error connecting to Google Play services.
-  } catch (GooglePlayServicesNotAvailableException e) {
-    // Google Play services is not available entirely.
-  }
-  final String id = adInfo.getId();
-  final boolean isLAT = adInfo.isLimitAdTrackingEnabled();
-}