You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

599 lines
25 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  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. @class FIRAuthRequestConfiguration;
  18. @class FIRCreateAuthURIRequest;
  19. @class FIRCreateAuthURIResponse;
  20. @class FIRDeleteAccountRequest;
  21. @class FIRDeleteAccountResponse;
  22. @class FIREmailLinkSignInRequest;
  23. @class FIREmailLinkSignInResponse;
  24. @class FIRGetAccountInfoRequest;
  25. @class FIRGetAccountInfoResponse;
  26. @class FIRGetProjectConfigRequest;
  27. @class FIRGetProjectConfigResponse;
  28. @class FIRGetOOBConfirmationCodeRequest;
  29. @class FIRGetOOBConfirmationCodeResponse;
  30. @class FIRResetPasswordRequest;
  31. @class FIRResetPasswordResponse;
  32. @class FIRSecureTokenRequest;
  33. @class FIRSecureTokenResponse;
  34. @class FIRSetAccountInfoRequest;
  35. @class FIRSetAccountInfoResponse;
  36. @class FIRVerifyAssertionRequest;
  37. @class FIRVerifyAssertionResponse;
  38. @class FIRVerifyClientRequest;
  39. @class FIRVerifyClientResponse;
  40. @class FIRVerifyCustomTokenRequest;
  41. @class FIRVerifyCustomTokenResponse;
  42. @class FIRVerifyPasswordRequest;
  43. @class FIRVerifyPasswordResponse;
  44. @class FIRVerifyPhoneNumberRequest;
  45. @class FIRVerifyPhoneNumberResponse;
  46. @class FIRSendVerificationCodeRequest;
  47. @class FIRSendVerificationCodeResponse;
  48. @class FIRSignInWithGameCenterRequest;
  49. @class FIRSignInWithGameCenterResponse;
  50. @class FIRSignUpNewUserRequest;
  51. @class FIRSignUpNewUserResponse;
  52. @protocol FIRAuthBackendImplementation;
  53. @protocol FIRAuthBackendRPCIssuer;
  54. NS_ASSUME_NONNULL_BEGIN
  55. /** @typedef FIRAuthBackendRPCIssuerCompletionHandler
  56. @brief The type of block used to return the result of a call to an endpoint.
  57. @param data The HTTP response body.
  58. @param error The error which occurred, if any.
  59. @remarks One of response or error will be non-nil.
  60. */
  61. typedef void (^FIRAuthBackendRPCIssuerCompletionHandler)(NSData *_Nullable data,
  62. NSError *_Nullable error);
  63. /** @typedef FIRCreateAuthURIResponseCallback
  64. @brief The type of block used to return the result of a call to the createAuthURI
  65. endpoint.
  66. @param response The received response, if any.
  67. @param error The error which occurred, if any.
  68. @remarks One of response or error will be non-nil.
  69. */
  70. typedef void (^FIRCreateAuthURIResponseCallback)
  71. (FIRCreateAuthURIResponse *_Nullable response, NSError *_Nullable error);
  72. /** @typedef FIRGetAccountInfoResponseCallback
  73. @brief The type of block used to return the result of a call to the getAccountInfo
  74. endpoint.
  75. @param response The received response, if any.
  76. @param error The error which occurred, if any.
  77. @remarks One of response or error will be non-nil.
  78. */
  79. typedef void (^FIRGetAccountInfoResponseCallback)
  80. (FIRGetAccountInfoResponse *_Nullable response, NSError *_Nullable error);
  81. /** @typedef FIRGetProjectConfigResponseCallback
  82. @brief The type of block used to return the result of a call to the getProjectInfo
  83. endpoint.
  84. @param response The received response, if any.
  85. @param error The error which occurred, if any.
  86. @remarks One of response or error will be non-nil.
  87. */
  88. typedef void (^FIRGetProjectConfigResponseCallback)
  89. (FIRGetProjectConfigResponse *_Nullable response, NSError *_Nullable error);
  90. /** @typedef FIRSetAccountInfoResponseCallback
  91. @brief The type of block used to return the result of a call to the setAccountInfo
  92. endpoint.
  93. @param response The received response, if any.
  94. @param error The error which occurred, if any.
  95. @remarks One of response or error will be non-nil.
  96. */
  97. typedef void (^FIRSetAccountInfoResponseCallback)
  98. (FIRSetAccountInfoResponse *_Nullable response, NSError *_Nullable error);
  99. /** @typedef FIRSecureTokenResponseCallback
  100. @brief The type of block used to return the result of a call to the token endpoint.
  101. @param response The received response, if any.
  102. @param error The error which occurred, if any.
  103. @remarks One of response or error will be non-nil.
  104. */
  105. typedef void (^FIRSecureTokenResponseCallback)
  106. (FIRSecureTokenResponse *_Nullable response, NSError *_Nullable error);
  107. /** @typedef FIRVerifyAssertionResponseCallback
  108. @brief The type of block used to return the result of a call to the verifyAssertion
  109. endpoint.
  110. @param response The received response, if any.
  111. @param error The error which occurred, if any.
  112. @remarks One of response or error will be non-nil.
  113. */
  114. typedef void (^FIRVerifyAssertionResponseCallback)
  115. (FIRVerifyAssertionResponse *_Nullable response, NSError *_Nullable error);
  116. /** @typedef FIRVerifyPasswordResponseCallback
  117. @brief The type of block used to return the result of a call to the verifyPassword
  118. endpoint.
  119. @param response The received response, if any.
  120. @param error The error which occurred, if any.
  121. @remarks One of response or error will be non-nil.
  122. */
  123. typedef void (^FIRVerifyPasswordResponseCallback)
  124. (FIRVerifyPasswordResponse *_Nullable response, NSError *_Nullable error);
  125. /** @typedef FIREmailLinkSigninResponseCallback
  126. @brief The type of block used to return the result of a call to the emailLinkSignin
  127. endpoint.
  128. @param response The received response, if any.
  129. @param error The error which occurred, if any.
  130. @remarks One of response or error will be non-nil.
  131. */
  132. typedef void (^FIREmailLinkSigninResponseCallback)
  133. (FIREmailLinkSignInResponse *_Nullable response, NSError *_Nullable error);
  134. /** @typedef FIRVerifyCustomTokenResponseCallback
  135. @brief The type of block used to return the result of a call to the verifyCustomToken
  136. endpoint.
  137. @param response The received response, if any.
  138. @param error The error which occurred, if any.
  139. @remarks One of response or error will be non-nil.
  140. */
  141. typedef void (^FIRVerifyCustomTokenResponseCallback)
  142. (FIRVerifyCustomTokenResponse *_Nullable response, NSError *_Nullable error);
  143. /** @typedef FIRDeleteCallBack
  144. @brief The type of block called when a request delete account has finished.
  145. @param error The error which occurred, or nil if the request was successful.
  146. */
  147. typedef void (^FIRDeleteCallBack)(NSError *_Nullable error);
  148. /** @typedef FIRGetOOBConfirmationCodeResponseCallback
  149. @brief The type of block used to return the result of a call to the getOOBConfirmationCode
  150. endpoint.
  151. @param response The received response, if any.
  152. @param error The error which occurred, if any.
  153. @remarks One of response or error will be non-nil.
  154. */
  155. typedef void (^FIRGetOOBConfirmationCodeResponseCallback)
  156. (FIRGetOOBConfirmationCodeResponse *_Nullable response, NSError *_Nullable error);
  157. /** @typedef FIRSignupNewUserCallback
  158. @brief The type of block used to return the result of a call to the signupNewUser endpoint.
  159. @param response The received response, if any.
  160. @param error The error which occurred, if any.
  161. @remarks One of response or error will be non-nil.
  162. */
  163. typedef void (^FIRSignupNewUserCallback)
  164. (FIRSignUpNewUserResponse *_Nullable response, NSError *_Nullable error);
  165. /** @typedef FIRResetPasswordCallback
  166. @brief The type of block used to return the result of a call to the resetPassword endpoint.
  167. @param response The received response, if any.
  168. @param error The error which occurred, if any.
  169. @remarks One of response or error will be non-nil.
  170. */
  171. typedef void (^FIRResetPasswordCallback)
  172. (FIRResetPasswordResponse *_Nullable response, NSError *_Nullable error);
  173. /** @typedef FIRSendVerificationCodeResponseCallback
  174. @brief The type of block used to return the result of a call to the sendVerificationCode
  175. endpoint.
  176. @param response The received response, if any.
  177. @param error The error which occurred, if any.
  178. @remarks One of response or error will be non-nil.
  179. */
  180. typedef void (^FIRSendVerificationCodeResponseCallback)
  181. (FIRSendVerificationCodeResponse *_Nullable response, NSError *_Nullable error);
  182. /** @typedef FIRVerifyPhoneNumberResponseCallback
  183. @brief The type of block used to return the result of a call to the verifyPhoneNumber endpoint.
  184. @param response The received response, if any.
  185. @param error The error which occurred, if any.
  186. @remarks One of response or error will be non-nil.
  187. */
  188. typedef void (^FIRVerifyPhoneNumberResponseCallback)
  189. (FIRVerifyPhoneNumberResponse *_Nullable response, NSError *_Nullable error);
  190. /** @typedef FIRVerifyClientResponseCallback
  191. @brief The type of block used to return the result of a call to the verifyClient endpoint.
  192. @param response The received response, if any.
  193. @param error The error which occurred, if any.
  194. @remarks One of response or error will be non-nil.
  195. */
  196. typedef void (^FIRVerifyClientResponseCallback)
  197. (FIRVerifyClientResponse *_Nullable response, NSError *_Nullable error);
  198. /** @typedef FIRSignInWithGameCenterResponseCallback
  199. @brief The type of block used to return the result of a call to the SignInWithGameCenter endpoint.
  200. @param response The received response, if any.
  201. @param error The error which occurred, if any.
  202. @remarks One of response or error will be non-nil.
  203. */
  204. typedef void (^FIRSignInWithGameCenterResponseCallback)
  205. (FIRSignInWithGameCenterResponse *_Nullable response, NSError *_Nullable error);
  206. /** @class FIRAuthBackend
  207. @brief Simple static class with methods representing the backend RPCs.
  208. @remarks All callback blocks passed as method parameters are invoked asynchronously on the
  209. global work queue in the future. See
  210. https://github.com/firebase/firebase-ios-sdk/tree/master/Firebase/Auth/Docs/threading.ml
  211. */
  212. @interface FIRAuthBackend : NSObject
  213. /** @fn authUserAgent
  214. @brief Retrieves the Firebase Auth user agent.
  215. @return The Firebase Auth user agent.
  216. */
  217. + (NSString *)authUserAgent;
  218. /** @fn setBackendImplementation:
  219. @brief Changes the default backend implementation to something else.
  220. @param backendImplementation The backend implementation to use.
  221. @remarks This is not, generally, safe to call in a scenario where other backend requests may
  222. be occuring. This is specifically to help mock the backend for testing purposes.
  223. */
  224. + (void)setBackendImplementation:(id<FIRAuthBackendImplementation>)backendImplementation;
  225. /** @fn setDefaultBackendImplementationWithRPCIssuer:
  226. @brief Uses the default backend implementation, but with a custom RPC issuer.
  227. @param RPCIssuer The RPC issuer to use. If @c nil, will use the default implementation.
  228. @remarks This is not, generally, safe to call in a scenario where other backend requests may
  229. be occuring. This is specifically to help test the backend interfaces (requests, responses,
  230. and shared FIRAuthBackend logic.)
  231. */
  232. + (void)setDefaultBackendImplementationWithRPCIssuer:
  233. (nullable id<FIRAuthBackendRPCIssuer>)RPCIssuer;
  234. /** @fn createAuthURI:callback:
  235. @brief Calls the createAuthURI endpoint, which is responsible for creating the URI used by the
  236. IdP to authenticate the user.
  237. @param request The request parameters.
  238. @param callback The callback.
  239. */
  240. + (void)createAuthURI:(FIRCreateAuthURIRequest *)request
  241. callback:(FIRCreateAuthURIResponseCallback)callback;
  242. /** @fn getAccountInfo:callback:
  243. @brief Calls the getAccountInfo endpoint, which returns account info for a given account.
  244. @param request The request parameters.
  245. @param callback The callback.
  246. */
  247. + (void)getAccountInfo:(FIRGetAccountInfoRequest *)request
  248. callback:(FIRGetAccountInfoResponseCallback)callback;
  249. /** @fn getProjectConfig:callback:
  250. @brief Calls the getProjectConfig endpoint, which returns configuration information for a given
  251. project.
  252. @param request An object wrapping the backend get request.
  253. @param callback The callback.
  254. */
  255. + (void)getProjectConfig:(FIRGetProjectConfigRequest *)request
  256. callback:(FIRGetProjectConfigResponseCallback)callback;
  257. /** @fn setAccountInfo:callback:
  258. @brief Calls the setAccountInfo endpoint, which is responsible for setting account info for a
  259. user, for example, to sign up a new user with email and password.
  260. @param request The request parameters.
  261. @param callback The callback.
  262. */
  263. + (void)setAccountInfo:(FIRSetAccountInfoRequest *)request
  264. callback:(FIRSetAccountInfoResponseCallback)callback;
  265. /** @fn verifyAssertion:callback:
  266. @brief Calls the verifyAssertion endpoint, which is responsible for authenticating a
  267. user who has IDP-related credentials (an ID Token, an Access Token, etc.)
  268. @param request The request parameters.
  269. @param callback The callback.
  270. */
  271. + (void)verifyAssertion:(FIRVerifyAssertionRequest *)request
  272. callback:(FIRVerifyAssertionResponseCallback)callback;
  273. /** @fn verifyCustomToken:callback:
  274. @brief Calls the verifyCustomToken endpoint, which is responsible for authenticating a
  275. user who has BYOAuth credentials (a self-signed token using their BYOAuth private key.)
  276. @param request The request parameters.
  277. @param callback The callback.
  278. */
  279. + (void)verifyCustomToken:(FIRVerifyCustomTokenRequest *)request
  280. callback:(FIRVerifyCustomTokenResponseCallback)callback;
  281. /** @fn verifyPassword:callback:
  282. @brief Calls the verifyPassword endpoint, which is responsible for authenticating a
  283. user who has email and password credentials.
  284. @param request The request parameters.
  285. @param callback The callback.
  286. */
  287. + (void)verifyPassword:(FIRVerifyPasswordRequest *)request
  288. callback:(FIRVerifyPasswordResponseCallback)callback;
  289. /** @fn emailLinkSignin:callback:
  290. @brief Calls the emailLinkSignin endpoint, which is responsible for authenticating a
  291. user through passwordless sign-in.
  292. @param request The request parameters.
  293. @param callback The callback.
  294. */
  295. + (void)emailLinkSignin:(FIREmailLinkSignInRequest *)request
  296. callback:(FIREmailLinkSigninResponseCallback)callback;
  297. /** @fn secureToken:callback:
  298. @brief Calls the token endpoint, which is responsible for performing STS token exchanges and
  299. token refreshes.
  300. @param request The request parameters.
  301. @param callback The callback.
  302. */
  303. + (void)secureToken:(FIRSecureTokenRequest *)request
  304. callback:(FIRSecureTokenResponseCallback)callback;
  305. /** @fn getOOBConfirmationCode:callback:
  306. @brief Calls the getOOBConfirmationCode endpoint, which is responsible for sending email change
  307. request emails, and password reset emails.
  308. @param request The request parameters.
  309. @param callback The callback.
  310. */
  311. + (void)getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)request
  312. callback:(FIRGetOOBConfirmationCodeResponseCallback)callback;
  313. /** @fn signUpNewUser:
  314. @brief Calls the signUpNewUser endpoint, which is responsible anonymously signing up a user
  315. or signing in a user anonymously.
  316. @param request The request parameters.
  317. @param callback The callback.
  318. */
  319. + (void)signUpNewUser:(FIRSignUpNewUserRequest *)request
  320. callback:(FIRSignupNewUserCallback)callback;
  321. /** @fn resetPassword:callback
  322. @brief Calls the resetPassword endpoint, which is responsible for resetting a user's password
  323. given an OOB code and new password.
  324. @param request The request parameters.
  325. @param callback The callback.
  326. */
  327. + (void)resetPassword:(FIRResetPasswordRequest *)request
  328. callback:(FIRResetPasswordCallback)callback;
  329. /** @fn deleteAccount:
  330. @brief Calls the DeleteAccount endpoint, which is responsible for deleting a user.
  331. @param request The request parameters.
  332. @param callback The callback.
  333. */
  334. + (void)deleteAccount:(FIRDeleteAccountRequest *)request
  335. callback:(FIRDeleteCallBack)callback;
  336. /** @fn SignInWithGameCenter:callback:
  337. @brief Calls the SignInWithGameCenter endpoint, which is responsible for authenticating a user
  338. who has Game Center credentials.
  339. @param request The request parameters.
  340. @param callback The callback.
  341. */
  342. + (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
  343. callback:(FIRSignInWithGameCenterResponseCallback)callback;
  344. #if TARGET_OS_IOS
  345. /** @fn sendVerificationCode:callback:
  346. @brief Calls the sendVerificationCode endpoint, which is responsible for sending the
  347. verification code to a phone number specified in the request parameters.
  348. @param request The request parameters.
  349. @param callback The callback.
  350. */
  351. + (void)sendVerificationCode:(FIRSendVerificationCodeRequest *)request
  352. callback:(FIRSendVerificationCodeResponseCallback)callback;
  353. /** @fn verifyPhoneNumber:callback:
  354. @brief Calls the verifyPhoneNumber endpoint, which is responsible for sending the verification
  355. code to a phone number specified in the request parameters.
  356. @param request The request parameters.
  357. @param callback The callback.
  358. */
  359. + (void)verifyPhoneNumber:(FIRVerifyPhoneNumberRequest *)request
  360. callback:(FIRVerifyPhoneNumberResponseCallback)callback;
  361. /** @fn verifyClient:callback:
  362. @brief Calls the verifyClient endpoint, which is responsible for sending the silent push
  363. notification used for app validation to the device provided in the request parameters.
  364. @param request The request parameters.
  365. @param callback The callback.
  366. */
  367. + (void)verifyClient:(FIRVerifyClientRequest *)request
  368. callback:(FIRVerifyClientResponseCallback)callback;
  369. #endif
  370. @end
  371. /** @protocol FIRAuthBackendRPCIssuer
  372. @brief Used to make FIRAuthBackend
  373. */
  374. @protocol FIRAuthBackendRPCIssuer <NSObject>
  375. /** @fn asyncPostToURLWithRequestConfiguration:URL:body:contentType:completionHandler:
  376. @brief Asynchronously seXnds a POST request.
  377. @param requestConfiguration The request to be made.
  378. @param URL The request URL.
  379. @param body Request body.
  380. @param contentType Content type of the body.
  381. @param handler provided that handles POST response. Invoked asynchronously on the auth global
  382. work queue in the future.
  383. */
  384. - (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
  385. URL:(NSURL *)URL
  386. body:(nullable NSData *)body
  387. contentType:(NSString *)contentType
  388. completionHandler:(FIRAuthBackendRPCIssuerCompletionHandler)handler;
  389. @end
  390. /** @protocol FIRAuthBackendImplementation
  391. @brief Used to make FIRAuthBackend provide a layer of indirection to an actual RPC-based backend
  392. or a mock backend.
  393. */
  394. @protocol FIRAuthBackendImplementation <NSObject>
  395. /** @fn createAuthURI:callback:
  396. @brief Calls the createAuthURI endpoint, which is responsible for creating the URI used by the
  397. IdP to authenticate the user.
  398. @param request The request parameters.
  399. @param callback The callback.
  400. */
  401. - (void)createAuthURI:(FIRCreateAuthURIRequest *)request
  402. callback:(FIRCreateAuthURIResponseCallback)callback;
  403. /** @fn getAccountInfo:callback:
  404. @brief Calls the getAccountInfo endpoint, which returns account info for a given account.
  405. @param request The request parameters.
  406. @param callback The callback.
  407. */
  408. - (void)getAccountInfo:(FIRGetAccountInfoRequest *)request
  409. callback:(FIRGetAccountInfoResponseCallback)callback;
  410. /** @fn getProjectConfig:callback:
  411. @brief Calls the getProjectInfo endpoint, which returns configuration information for a given
  412. project.
  413. @param request The request parameters.
  414. @param callback The callback.
  415. */
  416. - (void)getProjectConfig:(FIRGetProjectConfigRequest *)request
  417. callback:(FIRGetProjectConfigResponseCallback)callback;
  418. /** @fn setAccountInfo:callback:
  419. @brief Calls the setAccountInfo endpoint, which is responsible for setting account info for a
  420. user, for example, to sign up a new user with email and password.
  421. @param request The request parameters.
  422. @param callback The callback.
  423. */
  424. - (void)setAccountInfo:(FIRSetAccountInfoRequest *)request
  425. callback:(FIRSetAccountInfoResponseCallback)callback;
  426. /** @fn verifyAssertion:callback:
  427. @brief Calls the verifyAssertion endpoint, which is responsible for authenticating a
  428. user who has IDP-related credentials (an ID Token, an Access Token, etc.)
  429. @param request The request parameters.
  430. @param callback The callback.
  431. */
  432. - (void)verifyAssertion:(FIRVerifyAssertionRequest *)request
  433. callback:(FIRVerifyAssertionResponseCallback)callback;
  434. /** @fn verifyCustomToken:callback:
  435. @brief Calls the verifyCustomToken endpoint, which is responsible for authenticating a
  436. user who has BYOAuth credentials (a self-signed token using their BYOAuth private key.)
  437. @param request The request parameters.
  438. @param callback The callback.
  439. */
  440. - (void)verifyCustomToken:(FIRVerifyCustomTokenRequest *)request
  441. callback:(FIRVerifyCustomTokenResponseCallback)callback;
  442. /** @fn verifyPassword:callback:
  443. @brief Calls the verifyPassword endpoint, which is responsible for authenticating a
  444. user who has email and password credentials.
  445. @param request The request parameters.
  446. @param callback The callback.
  447. */
  448. - (void)verifyPassword:(FIRVerifyPasswordRequest *)request
  449. callback:(FIRVerifyPasswordResponseCallback)callback;
  450. /** @fn emailLinkSignin:callback:
  451. @brief Calls the emailLinkSignin endpoint, which is responsible for authenticating a
  452. user through passwordless sign-in.
  453. @param request The request parameters.
  454. @param callback The callback.
  455. */
  456. - (void)emailLinkSignin:(FIREmailLinkSignInRequest *)request
  457. callback:(FIREmailLinkSigninResponseCallback)callback;
  458. /** @fn secureToken:callback:
  459. @brief Calls the token endpoint, which is responsible for performing STS token exchanges and
  460. token refreshes.
  461. @param request The request parameters.
  462. @param callback The callback.
  463. */
  464. - (void)secureToken:(FIRSecureTokenRequest *)request
  465. callback:(FIRSecureTokenResponseCallback)callback;
  466. /** @fn getOOBConfirmationCode:callback:
  467. @brief Calls the getOOBConfirmationCode endpoint, which is responsible for sending email change
  468. request emails, email sign-in link emails, and password reset emails.
  469. @param request The request parameters.
  470. @param callback The callback.
  471. */
  472. - (void)getOOBConfirmationCode:(FIRGetOOBConfirmationCodeRequest *)request
  473. callback:(FIRGetOOBConfirmationCodeResponseCallback)callback;
  474. /** @fn signUpNewUser:
  475. @brief Calls the signUpNewUser endpoint, which is responsible anonymously signing up a user
  476. or signing in a user anonymously.
  477. @param request The request parameters.
  478. @param callback The callback.
  479. */
  480. - (void)signUpNewUser:(FIRSignUpNewUserRequest *)request
  481. callback:(FIRSignupNewUserCallback)callback;
  482. /** @fn deleteAccount:
  483. @brief Calls the DeleteAccount endpoint, which is responsible for deleting a user.
  484. @param request The request parameters.
  485. @param callback The callback.
  486. */
  487. - (void)deleteAccount:(FIRDeleteAccountRequest *)request
  488. callback:(FIRDeleteCallBack)callback;
  489. #if TARGET_OS_IOS
  490. /** @fn sendVerificationCode:callback:
  491. @brief Calls the sendVerificationCode endpoint, which is responsible for sending the
  492. verification code to a phone number specified in the request parameters.
  493. @param request The request parameters.
  494. @param callback The callback.
  495. */
  496. - (void)sendVerificationCode:(FIRSendVerificationCodeRequest *)request
  497. callback:(FIRSendVerificationCodeResponseCallback)callback;
  498. /** @fn verifyPhoneNumber:callback:
  499. @brief Calls the verifyPhoneNumber endpoint, which is responsible for sending the verification
  500. code to a phone number specified in the request parameters.
  501. @param request The request parameters.
  502. @param callback The callback.
  503. */
  504. - (void)verifyPhoneNumber:(FIRVerifyPhoneNumberRequest *)request
  505. callback:(FIRVerifyPhoneNumberResponseCallback)callback;
  506. /** @fn verifyClient:callback:
  507. @brief Calls the verifyClient endpoint, which is responsible for sending the silent push
  508. notification used for app validation to the device provided in the request parameters.
  509. @param request The request parameters.
  510. @param callback The callback.
  511. */
  512. - (void)verifyClient:(FIRVerifyClientRequest *)request
  513. callback:(FIRVerifyClientResponseCallback)callback;
  514. #endif
  515. /** @fn SignInWithGameCenter:callback:
  516. @brief Calls the SignInWithGameCenter endpoint, which is responsible for authenticating a user
  517. who has Game Center credentials.
  518. @param request The request parameters.
  519. @param callback The callback.
  520. */
  521. - (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
  522. callback:(FIRSignInWithGameCenterResponseCallback)callback;
  523. /** @fn resetPassword:callback
  524. @brief Calls the resetPassword endpoint, which is responsible for resetting a user's password
  525. given an OOB code and new password.
  526. @param request The request parameters.
  527. @param callback The callback.
  528. */
  529. - (void)resetPassword:(FIRResetPasswordRequest *)request
  530. callback:(FIRResetPasswordCallback)callback;
  531. @end
  532. NS_ASSUME_NONNULL_END