| class info |
| public abstract class InstallReferrerClient |
| Abstract class used to obtain install referrer information. |
| Return type | Method name |
| InstallReferrerClient.Builder | newBuilder(Context context) Creates an InstallReferrerClient.Builder instance. |
| void | startConnection(InstallReferrerStateListener listener) Starts to connect to the install referrer service. |
| void | endConnection() Ends the service connection and releases all occupied resources. |
| boolean | isReady() Indicates whether the service connection is ready. |
| ReferrerDetails | getInstallReferrer() Obtains install referrer information. |
| 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 name | Parameter desc |
| context | Standard context in Android. |
Return
| Return type | desc |
| 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 name | Parameter desc |
| listener | Connection status callback API. |
Return
| Return type | desc |
| 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 type | desc |
| ReferrerDetails | A ReferrerDetails object is returned. |
Throws
| Parameter name | Parameter desc |
| RemoteException | Remote service error. |
| IOException | Other errors. |