No Description

FIRGetOOBConfirmationCodeRequest.h 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FIRAuthRPCRequest.h"
  18. #import "FIRIdentityToolkitRequest.h"
  19. @class FIRActionCodeSettings;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** @enum FIRGetOOBConfirmationCodeRequestType
  22. @brief Types of OOB Confirmation Code requests.
  23. */
  24. typedef NS_ENUM(NSInteger, FIRGetOOBConfirmationCodeRequestType) {
  25. /** @var FIRGetOOBConfirmationCodeRequestTypePasswordReset
  26. @brief Requests a password reset code.
  27. */
  28. FIRGetOOBConfirmationCodeRequestTypePasswordReset,
  29. /** @var FIRGetOOBConfirmationCodeRequestTypeVerifyEmail
  30. @brief Requests an email verification code.
  31. */
  32. FIRGetOOBConfirmationCodeRequestTypeVerifyEmail,
  33. /** @var FIRGetOOBConfirmationCodeRequestTypeEmailLink
  34. @brief Requests an email sign-in link.
  35. */
  36. FIRGetOOBConfirmationCodeRequestTypeEmailLink,
  37. };
  38. /** @enum FIRGetOOBConfirmationCodeRequest
  39. @brief Represents the parameters for the getOOBConfirmationCode endpoint.
  40. */
  41. @interface FIRGetOOBConfirmationCodeRequest : FIRIdentityToolkitRequest <FIRAuthRPCRequest>
  42. /** @property requestType
  43. @brief The types of OOB Confirmation Code to request.
  44. */
  45. @property(nonatomic, assign, readonly) FIRGetOOBConfirmationCodeRequestType requestType;
  46. /** @property email
  47. @brief The email of the user.
  48. @remarks For password reset.
  49. */
  50. @property(nonatomic, copy, nullable, readonly) NSString *email;
  51. /** @property accessToken
  52. @brief The STS Access Token of the authenticated user.
  53. @remarks For email change.
  54. */
  55. @property(nonatomic, copy, nullable, readonly) NSString *accessToken;
  56. /** @property continueURL
  57. @brief This URL represents the state/Continue URL in the form of a universal link.
  58. */
  59. @property(nonatomic, copy, nullable, readonly) NSString *continueURL;
  60. /** @property iOSBundleID
  61. @brief The iOS bundle Identifier, if available.
  62. */
  63. @property(nonatomic, copy, nullable, readonly) NSString *iOSBundleID;
  64. /** @property androidPackageName
  65. @brief The Android package name, if available.
  66. */
  67. @property(nonatomic, copy, nullable, readonly) NSString *androidPackageName;
  68. /** @property androidMinimumVersion
  69. @brief The minimum Android version supported, if available.
  70. */
  71. @property(nonatomic, copy, nullable, readonly) NSString *androidMinimumVersion;
  72. /** @property androidInstallIfNotAvailable
  73. @brief Indicates whether or not the Android app should be installed if not already available.
  74. */
  75. @property(nonatomic, assign, readonly) BOOL androidInstallApp;
  76. /** @property handleCodeInApp
  77. @brief Indicates whether the action code link will open the app directly or after being
  78. redirected from a Firebase owned web widget.
  79. */
  80. @property(assign, nonatomic) BOOL handleCodeInApp;
  81. /** @property dynamicLinkDomain
  82. @brief The Firebase Dynamic Link domain used for out of band code flow.
  83. */
  84. @property (copy, nonatomic, nullable) NSString *dynamicLinkDomain;
  85. /** @fn passwordResetRequestWithEmail:actionCodeSettings:requestConfiguration:
  86. @brief Creates a password reset request.
  87. @param email The user's email address.
  88. @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
  89. settings to be applied to the password reset request.
  90. @param requestConfiguration An object containing configurations to be added to the request.
  91. @return A password reset request.
  92. */
  93. + (nullable FIRGetOOBConfirmationCodeRequest *)
  94. passwordResetRequestWithEmail:(NSString *)email
  95. actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
  96. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
  97. /** @fn verifyEmailRequestWithAccessToken:actionCodeSettings:requestConfiguration:
  98. @brief Creates a password reset request.
  99. @param accessToken The user's STS Access Token.
  100. @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
  101. settings to be applied to the email verification request.
  102. @param requestConfiguration An object containing configurations to be added to the request.
  103. @return A password reset request.
  104. */
  105. + (nullable FIRGetOOBConfirmationCodeRequest *)
  106. verifyEmailRequestWithAccessToken:(NSString *)accessToken
  107. actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
  108. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
  109. /** @fn signInWithEmailLinkRequest:actionCodeSettings:requestConfiguration:
  110. @brief Creates a sign-in with email link.
  111. @param email The user's email address.
  112. @param actionCodeSettings An object of FIRActionCodeSettings which specifies action code
  113. settings to be applied to the email sign-in link.
  114. @param requestConfiguration An object containing configurations to be added to the request.
  115. @return An email sign-in link request.
  116. */
  117. + (nullable FIRGetOOBConfirmationCodeRequest *)
  118. signInWithEmailLinkRequest:(NSString *)email
  119. actionCodeSettings:(nullable FIRActionCodeSettings *)actionCodeSettings
  120. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration;
  121. /** @fn init
  122. @brief Please use a factory method.
  123. */
  124. - (nullable instancetype)initWithEndpoint:(NSString *)endpoint
  125. requestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  126. NS_UNAVAILABLE;
  127. @end
  128. NS_ASSUME_NONNULL_END