java.lang.Object
it.auties.whatsapp.registration.HttpRegistration
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.auties.whatsapp.registration.apns.ApnsClientprivate final AsyncVerificationCodeSupplierprivate final HttpClientprivate final Keysprivate final VerificationCodeMethodprivate final Storeprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionHttpRegistration(Store store, Keys keys, AsyncVerificationCodeSupplier codeHandler, VerificationCodeMethod method) -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> CompletableFuture<T> private StringconvertBufferToUrlHex(byte[] buffer) private HttpClientprivate byte[]private HttpRequestcreateRequest(String path, Map<String, Object> params) private voiddispose()exists()exists(String pushToken, VerificationCodeError lastError) private Stringprivate CompletableFuture<String> private CompletableFuture<String> private CompletableFuture<Map<String, Object>> getRegistrationOptions(Store store, Keys keys, boolean useToken, boolean isRetry, Map.Entry<String, Object>... attributes) getRequestVerificationCodeParameters(HttpRegistration.ExistsResponse existsResponse) private StringnormalizeCodeResult(String captcha) private CompletableFuture<AbPropsResponse> private CompletionStage<Void> onCodeRequestSent(HttpRegistration.ExistsResponse existsResponse, VerificationCodeError lastError, HttpResponse<String> result) private voidonRequestVerificationCode(boolean closeResources, Throwable exception) private StringpadCountryCodeValue(String inputString) private StringreadIOSPushCode(it.auties.whatsapp.registration.apns.ApnsPacket packet) private CompletableFuture<Void> requestVerificationCode(boolean closeResources) private CompletableFuture<Void> requestVerificationCode(HttpRegistration.ExistsResponse existsResponse, VerificationCodeError lastError) private voidsaveRegistrationStatus(Store store, Keys keys, boolean registered) private CompletableFuture<HttpResponse<String>> sendRequest(String path, Map<String, Object> params) private StringtoFormParams(Map<String, ?> values)
-
Field Details
-
TIMEOUT_SECONDS
private static final int TIMEOUT_SECONDS- See Also:
-
httpClient
-
store
-
keys
-
codeHandler
-
method
-
apnsClient
private final it.auties.whatsapp.registration.apns.ApnsClient apnsClient
-
-
Constructor Details
-
HttpRegistration
public HttpRegistration(Store store, Keys keys, AsyncVerificationCodeSupplier codeHandler, VerificationCodeMethod method)
-
-
Method Details
-
registerPhoneNumber
-
requestVerificationCode
-
requestVerificationCode
-
onRequestVerificationCode
-
onboard
-
exists
-
getIOSPushToken
-
getApnsAppName
-
exists
private CompletableFuture<HttpRegistration.ExistsResponse> exists(String pushToken, VerificationCodeError lastError) -
getIOSPushCode
-
readIOSPushCode
-
convertBufferToUrlHex
-
clientLog
@SafeVarargs private <T> CompletableFuture<T> clientLog(T data, Map.Entry<String, Object>... attributes) -
requestVerificationCode
private CompletableFuture<Void> requestVerificationCode(HttpRegistration.ExistsResponse existsResponse, VerificationCodeError lastError) -
getRequestVerificationCodeParameters
private Map.Entry<String,Object>[] getRequestVerificationCodeParameters(HttpRegistration.ExistsResponse existsResponse) -
onCodeRequestSent
private CompletionStage<Void> onCodeRequestSent(HttpRegistration.ExistsResponse existsResponse, VerificationCodeError lastError, HttpResponse<String> result) -
sendVerificationCode
-
padCountryCodeValue
-
saveRegistrationStatus
-
normalizeCodeResult
-
sendRequest
-
createRequest
-
createClient
-
getRegistrationOptions
@SafeVarargs private CompletableFuture<Map<String,Object>> getRegistrationOptions(Store store, Keys keys, boolean useToken, boolean isRetry, Map.Entry<String, Object>... attributes) -
createOfflineAb
private byte[] createOfflineAb() -
toFormParams
-
dispose
private void dispose()
-