Java Code Examples for com.google.firebase.auth.ActionCodeSettings#getUrl()

The following examples show how to use com.google.firebase.auth.ActionCodeSettings#getUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EmailLinkSendEmailHandler.java    From FirebaseUI-Android with Apache License 2.0 6 votes vote down vote up
private ActionCodeSettings addSessionInfoToActionCodeSettings(@NonNull ActionCodeSettings
                                                                      actionCodeSettings,
                                                              @NonNull String sessionId,
                                                              @NonNull String anonymousUserId,
                                                              @Nullable IdpResponse response,
                                                              boolean forceSameDevice) {

    String continueUrl = actionCodeSettings.getUrl();
    ContinueUrlBuilder continueUrlBuilder = new ContinueUrlBuilder(continueUrl);
    continueUrlBuilder.appendSessionId(sessionId);
    continueUrlBuilder.appendAnonymousUserId(anonymousUserId);
    continueUrlBuilder.appendForceSameDeviceBit(forceSameDevice);
    if (response != null) {
        continueUrlBuilder.appendProviderId(response.getProviderType());
    }

    return ActionCodeSettings.newBuilder()
            .setUrl(continueUrlBuilder.build())
            .setHandleCodeInApp(true)
            .setAndroidPackageName(actionCodeSettings.getAndroidPackageName(),
                    actionCodeSettings.getAndroidInstallApp(),
                    actionCodeSettings.getAndroidMinimumVersion())
            .setIOSBundleId(actionCodeSettings.getIOSBundle())
            .build();
}
 
Example 2
Source File: EmailLinkSendEmailHandlerTest.java    From FirebaseUI-Android with Apache License 2.0 5 votes vote down vote up
private void validateSessionIdAddedToContinueUrl(ActionCodeSettings actionCodeSettings,
                                                 String providerId,
                                                 boolean forceSameDevice) {
    EmailLinkParser parser = new EmailLinkParser(actionCodeSettings.getUrl());
    assertThat(parser.getSessionId()).isNotNull();
    assertThat(parser.getForceSameDeviceBit()).isEqualTo(forceSameDevice);
    assertThat(parser.getProviderId()).isEqualTo(providerId);
}