Interfejs API odesłania do instalacji z Play
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Ta dokumentacja zawiera informacje techniczne na temat korzystania z interfejsu Play Check Referrer API. Interfejs Play Check Referrer API to interfejs usługi AIL używany głównie przez programistów innych niż Java.
Uwaga: biblioteka odesłania do instalacji z Play to opakowanie z interfejsem Play Send Referrer API, które ma pomóc programistom w korzystaniu z niego w języku Java.
Metoda getInstallReferrer()
Ta metoda zwraca informacje o stronie odsyłającej do instalacji aplikacji odpowiadające podanej nazwie pakietu wysłanej za pomocą Bundle
(klucz zmapowany w tabeli 1). W odpowiedzi Bundle
wysłanej przez Google Play informacje o witrynie odsyłającej są przechowywane w polach zmapowanych na klucze opisane w tabeli 2.
Tabela 1. getInstallReferrer()
żądanie danych pakietu.
Parametr
|
Typ
|
Opis
|
package_name
|
String
|
Nazwa pakietu elementu wywołującego, służąca do ujednoznacznienia.
|
Tabela 2. Dane odpowiedzi z żądania getInstallReferrer()
.
Klucz
|
Typ
|
Opis
|
install_referrer
|
String
|
Adres URL strony odsyłającej zainstalowanego pakietu.
|
referrer_click_timestamp_seconds
|
long
|
Sygnatura czasowa (w sekundach) po kliknięciu strony odsyłającej po stronie klienta.
|
install_begin_timestamp_seconds
|
long
|
Sygnatura czasowa (w sekundach) po stronie klienta, która określa, kiedy rozpoczęła się instalacja aplikacji.
|
referrer_click_timestamp_server_seconds
|
long
|
Sygnatura czasowa po stronie serwera (w sekundach), kiedy miało miejsce kliknięcie strony odsyłającej.
|
install_begin_timestamp_server_seconds
|
long
|
Sygnatura czasowa po stronie serwera (w sekundach), która określa, kiedy rozpoczęła się instalacja aplikacji.
|
install_version
|
string
|
Wersja aplikacji w momencie jej pierwszej instalacji.
|
google_play_instant
|
boolean
|
Wskazuje, czy aplikacja błyskawiczna została uruchomiona w ciągu ostatnich 7 dni.
|
Uwaga: informacje o stronie odsyłającej do instalacji będą dostępne przez 90 dni i nie zmienią się, chyba że aplikacja zostanie ponownie zainstalowana. Aby uniknąć niepotrzebnych wywołań interfejsu API w aplikacji, wywołaj interfejs API tylko raz podczas pierwszego wykonania po instalacji.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# Play Install Referrer API\n\nThis documentation provides technical reference for using the\nPlay Install Referrer API. The Play Install Referrer API is an\n[AIDL Service Interface](https://developer.android.com/guide/components/aidl.html)\nprimarily used by non-Java programmers.\n\n\n**Note:** The\n[Play Install Referrer Library](/google/play/installreferrer/library)\nprovides a wrapper around the Play Install Referrer API and is designed to help Java\nprogrammers use the API.\n\nThe getInstallReferrer() method\n-------------------------------\n\nThis method returns the app install referrer information corresponding to the\ngiven package name sent through a `Bundle` (key mapped in table 1). In the\nresponse `Bundle` sent by Google Play, the referral information is stored in\nfields mapped to the keys detailed in table 2.\n\n\n**Table 1.** `getInstallReferrer()` bundle data\nrequest.\n\n| Parameter | Type | Description |\n|----------------|----------|----------------------------------------------------------|\n| `package_name` | `String` | The package name of the caller, used for disambiguation. |\n\n\n**Table 2.** Response data from a `getInstallReferrer()`\nrequest.\n\n| Key | Type | Description |\n|-------------------------------------------|-----------|--------------------------------------------------------------------------------------|\n| `install_referrer` | `String` | The referrer URL of the installed package. |\n| `referrer_click_timestamp_seconds` | `long` | The client-side timestamp, in seconds, when the referrer click happened. |\n| `install_begin_timestamp_seconds` | `long` | The client-side timestamp, in seconds, when app installation began. |\n| `referrer_click_timestamp_server_seconds` | `long` | The server-side timestamp, in seconds, when the referrer click happened. |\n| `install_begin_timestamp_server_seconds` | `long` | The server-side timestamp, in seconds, when app installation began. |\n| `install_version` | `string` | The app's version at the time when the app was first installed. |\n| `google_play_instant` | `boolean` | Indicates whether your app's instant experience was launched within the past 7 days. |\n\n**Caution:** The install referrer information will be\navailable for 90 days and **won't change** unless the application is\nreinstalled. To avoid unnecessary API calls in your app, you should invoke the\nAPI **only once** during the first execution after install."]]