目录

class info
public abstract class InstallReferrerClient
Abstract class used to obtain install referrer information.

Public Method Summary

Return typeMethod name
InstallReferrerClient.BuildernewBuilder(Context context)

Creates an InstallReferrerClient.Builder instance.

voidstartConnection(InstallReferrerStateListener listener)

Starts to connect to the install referrer service.

voidendConnection()

Ends the service connection and releases all occupied resources.

booleanisReady()

Indicates whether the service connection is ready.

ReferrerDetailsgetInstallReferrer()

Obtains install referrer information.

Public Methods

Method
public static InstallReferrerClient.Builder newBuilder(Context context)

Creates an InstallReferrerClient.Builder instance.

If the version of Huawei Mobile Services (APK) on a user device is earlier than 2.6.5, install referrer information cannot be obtained and IOException is thrown.


Parameters

Parameter nameParameter desc
contextStandard context in Android.

Return

Return typedesc
InstallReferrerClient.Builder

An InstallReferrerClient.Builder instance object is returned.

Method
public void startConnection(InstallReferrerStateListener listener)

Starts to connect to the install referrer service.

If the version of Huawei Mobile Services (APK) on a user device is earlier than 2.6.5, install referrer information cannot be obtained and IOException is thrown.

Parameters

Parameter nameParameter desc
listenerConnection status callback API.
Method
public void endConnection()

Ends the service connection and releases all occupied resources.

If the version of Huawei Mobile Services (APK) on a user device is earlier than 2.6.5, install referrer information cannot be obtained and IOException is thrown.

Method
public boolean isReady()

Indicates whether the service connection is ready.

If the version of Huawei Mobile Services (APK) on a user device is earlier than 2.6.5, install referrer information cannot be obtained and IOException is thrown.

Return

Return typedesc
boolean

true: The service is connected and ready to be called.

false: The service has not been connected and cannot be called.

Method
public ReferrerDetails getInstallReferrer() throws RemoteException, IOException

Obtains install referrer information.

If the version of Huawei Mobile Services (APK) on a user device is earlier than 2.6.5, install referrer information cannot be obtained and IOException is thrown.

Return

Return typedesc
ReferrerDetails

A ReferrerDetails object is returned.

Throws

Parameter nameParameter desc
RemoteExceptionRemote service error.
IOExceptionOther errors.