API Play Install Referrer
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa documentazione fornisce riferimenti tecnici per l'utilizzo dell'API Play Install Referrer. L'API Play Install Referrer è un'AIDL Service Interface utilizzata principalmente da programmatori non Java.
Nota: la libreria dei referrer di installazione di Play fornisce un wrapper per l'API Play Install Referrer ed è progettata per aiutare i programmatori Java a utilizzare l'API.
Il metodo getInstallReferrer()
Questo metodo restituisce le informazioni del referrer di installazione dell'app corrispondenti al nome del pacchetto specificato inviate tramite un codice Bundle
(chiave mappata nella tabella 1). Nella risposta Bundle
inviata da Google Play, le informazioni sui referral vengono archiviate in campi mappati alle chiavi dettagliate nella tabella 2.
Tabella 1. Richiesta di dati del pacchetto getInstallReferrer()
.
Parametro
|
Tipo
|
Descrizione
|
package_name
|
String
|
Il nome del pacchetto del chiamante, utilizzato per la disambiguazione.
|
Tabella 2. Dati di risposta a una richiesta getInstallReferrer()
.
Chiave
|
Tipo
|
Descrizione
|
install_referrer
|
String
|
L'URL referrer del pacchetto installato.
|
referrer_click_timestamp_seconds
|
long
|
Il timestamp lato client, in secondi, in cui si è verificato il clic del referrer.
|
install_begin_timestamp_seconds
|
long
|
Il timestamp lato client, in secondi, in cui è iniziata l'installazione dell'app.
|
referrer_click_timestamp_server_seconds
|
long
|
Il timestamp lato server, in secondi, in cui si è verificato il clic referrer.
|
install_begin_timestamp_server_seconds
|
long
|
Il timestamp lato server, in secondi, dell'inizio dell'installazione dell'app.
|
install_version
|
string
|
La versione dell'app alla data della sua prima installazione.
|
google_play_instant
|
boolean
|
Indica se l'app istantanea della tua app è stata lanciata
negli ultimi 7 giorni.
|
Attenzione: le informazioni sul referrer di installazione saranno disponibili per 90 giorni e non cambieranno a meno che l'applicazione non venga reinstallata. Per evitare chiamate API non necessarie nella tua app, devi richiamare l'API solo una volta durante la prima esecuzione dopo l'installazione.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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."]]