InstallReferrerClient
public
abstract
class
InstallReferrerClient
extends Object
java.lang.Object
|
↳ |
com.android.installreferrer.api.InstallReferrerClient
|
Main interface for communication between the library and user application code.
Summary
Nested classes |
class |
InstallReferrerClient.Builder
Builder to configure and create a InstallReferrer instance.
|
@interface |
InstallReferrerClient.InstallReferrerResponse
Possible return codes.
|
Inherited methods |
From
class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
InstallReferrerClient
InstallReferrerClient ()
Public methods
endConnection
void endConnection ()
Close the connection and release all held resources such as service connections.
Call this method once you are done with this InstallReferrerClient reference.
getInstallReferrer
ReferrerDetails getInstallReferrer ()
Get installation referrer details. This method uses information stored by the Google Play Store
app without initiating a network request.
isReady
boolean isReady ()
Checks if the client is currently connected to the service, so that requests to other methods
will succeed.
Returns true if the client is currently connected to the service, false otherwise.
Note: It also means that Install Referrer API is available for the current device.
startConnection
void startConnection (InstallReferrerStateListener listener)
Starts up InstallReferrerClient setup process asynchronously. You will be notified through the
InstallReferrerStateListener
listener when the setup process is complete.
Parameters |
listener |
InstallReferrerStateListener : The listener to notify when the setup process is complete.
|
Annotations
Interfaces
Classes
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# InstallReferrerClient\n\nSummary: [Nested Classes](#nestedclasses) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nInstallReferrerClient\n=====================\n\n\n`\npublic\n\n\nabstract\nclass\nInstallReferrerClient\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.installreferrer.api.InstallReferrerClient |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nMain interface for communication between the library and user application code.\n\nSummary\n-------\n\n| ### Nested classes ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) Builder to configure and create a InstallReferrer instance. |\n| ` @interface` | [InstallReferrerClient.InstallReferrerResponse](/reference/com/android/installreferrer/api/InstallReferrerClient.InstallReferrerResponse) Possible return codes. |\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[InstallReferrerClient](/reference/com/android/installreferrer/api/InstallReferrerClient#InstallReferrerClient())`() ` |\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[endConnection](/reference/com/android/installreferrer/api/InstallReferrerClient#endConnection())`() ` Close the connection and release all held resources such as service connections. |\n| ` abstract `[ReferrerDetails](/reference/com/android/installreferrer/api/ReferrerDetails) | ` `[getInstallReferrer](/reference/com/android/installreferrer/api/InstallReferrerClient#getInstallReferrer())`() ` Get installation referrer details. |\n| ` abstract boolean` | ` `[isReady](/reference/com/android/installreferrer/api/InstallReferrerClient#isReady())`() ` Checks if the client is currently connected to the service, so that requests to other methods will succeed. |\n| ` static `[InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) | ` `[newBuilder](/reference/com/android/installreferrer/api/InstallReferrerClient#newBuilder(android.content.Context))`(Context context) ` Constructs a new [InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) instance. |\n| ` abstract void` | ` `[startConnection](/reference/com/android/installreferrer/api/InstallReferrerClient#startConnection(com.android.installreferrer.api.InstallReferrerStateListener))`(`[InstallReferrerStateListener](/reference/com/android/installreferrer/api/InstallReferrerStateListener)` listener) ` Starts up InstallReferrerClient setup process asynchronously. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### InstallReferrerClient\n\n```\nInstallReferrerClient ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### endConnection\n\n```\nvoid endConnection ()\n```\n\nClose the connection and release all held resources such as service connections.\n\nCall this method once you are done with this InstallReferrerClient reference.\n\n\u003cbr /\u003e\n\n### getInstallReferrer\n\n```\nReferrerDetails getInstallReferrer ()\n```\n\nGet installation referrer details. This method uses information stored by the Google Play Store\napp without initiating a network request.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ReferrerDetails](/reference/com/android/installreferrer/api/ReferrerDetails) | ReferrerDetails The [ReferrerDetails](/reference/com/android/installreferrer/api/ReferrerDetails) with all install referrer information. \u003cbr /\u003e |\n\n| Throws ||\n|-------------------|---|\n| `RemoteException` | |\n\n### isReady\n\n```\nboolean isReady ()\n```\n\nChecks if the client is currently connected to the service, so that requests to other methods\nwill succeed.\n\nReturns true if the client is currently connected to the service, false otherwise.\n\nNote: It also means that Install Referrer API is available for the current device.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### newBuilder\n\n```\nInstallReferrerClient.Builder newBuilder (Context context)\n```\n\nConstructs a new [InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) instance.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------------|\n| `context` | `Context`: It will be used to get an application context to bind to the Install Referrer service. \u003cbr /\u003e |\n\n| Returns ||\n|-----------------------------------------------------------------------------------------------------------|--------|\n| [InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder) | \u003cbr /\u003e |\n\n### startConnection\n\n```\nvoid startConnection (InstallReferrerStateListener listener)\n```\n\nStarts up InstallReferrerClient setup process asynchronously. You will be notified through the\n[InstallReferrerStateListener](/reference/com/android/installreferrer/api/InstallReferrerStateListener) listener when the setup process is complete.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------|\n| `listener` | `InstallReferrerStateListener`: The listener to notify when the setup process is complete. \u003cbr /\u003e |\n\n-\n\n Annotations\n -----------\n\n - [InstallReferrerClient.InstallReferrerResponse](/reference/com/android/installreferrer/api/InstallReferrerClient.InstallReferrerResponse)\n-\n\n Interfaces\n ----------\n\n - [InstallReferrerStateListener](/reference/com/android/installreferrer/api/InstallReferrerStateListener)\n-\n\n Classes\n -------\n\n - [InstallReferrerClient](/reference/com/android/installreferrer/api/InstallReferrerClient)\n - [InstallReferrerClient.Builder](/reference/com/android/installreferrer/api/InstallReferrerClient.Builder)\n - [ReferrerDetails](/reference/com/android/installreferrer/api/ReferrerDetails)"]]