ObjCAPITests.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. // Copyright 2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <XCTest/XCTest.h>
  15. @import FirebaseCore;
  16. @import FirebaseAuth;
  17. #if !TARGET_OS_OSX && !TARGET_OS_WATCH
  18. @interface AuthUIImpl : NSObject <FIRAuthUIDelegate>
  19. - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^_Nullable)(void))completion;
  20. - (void)presentViewController:(nonnull UIViewController *)viewControllerToPresent
  21. animated:(BOOL)flag
  22. completion:(void (^_Nullable)(void))completion;
  23. @end
  24. @implementation AuthUIImpl
  25. - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^_Nullable)(void))completion {
  26. }
  27. - (void)presentViewController:(nonnull UIViewController *)viewControllerToPresent
  28. animated:(BOOL)flag
  29. completion:(void (^_Nullable)(void))completion {
  30. }
  31. @end
  32. #endif
  33. #if TARGET_OS_IOS
  34. @interface FederatedAuthImplementation : NSObject <FIRFederatedAuthProvider>
  35. - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
  36. completion:(nullable void (^)(FIRAuthCredential *_Nullable,
  37. NSError *_Nullable))completion;
  38. @end
  39. @implementation FederatedAuthImplementation
  40. - (void)getCredentialWithUIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
  41. completion:(nullable void (^)(FIRAuthCredential *_Nullable,
  42. NSError *_Nullable))completion {
  43. }
  44. @end
  45. #endif
  46. @interface ObjCAPICoverage : XCTestCase
  47. @end
  48. @implementation ObjCAPICoverage
  49. - (void)FIRActionCodeSettings_h {
  50. FIRActionCodeSettings *codeSettings = [[FIRActionCodeSettings alloc] init];
  51. [codeSettings setIOSBundleID:@"abc"];
  52. [codeSettings setAndroidPackageName:@"name" installIfNotAvailable:NO minimumVersion:@"1.1"];
  53. BOOL b = [codeSettings handleCodeInApp];
  54. b = [codeSettings androidInstallIfNotAvailable];
  55. __unused NSURL *u = [codeSettings URL];
  56. NSString *s = [codeSettings iOSBundleID];
  57. s = [codeSettings androidPackageName];
  58. s = [codeSettings androidMinimumVersion];
  59. s = [codeSettings dynamicLinkDomain];
  60. }
  61. - (void)FIRAuthAdditionalUserInfo_h:(FIRAdditionalUserInfo *)additionalUserInfo {
  62. NSString *s = [additionalUserInfo providerID];
  63. __unused BOOL b = [additionalUserInfo isNewUser];
  64. __unused NSDictionary<NSString *, NSObject *> *dict = [additionalUserInfo profile];
  65. s = [additionalUserInfo username];
  66. }
  67. - (void)ActionCodeOperationTests:(FIRActionCodeInfo *)info {
  68. __unused FIRActionCodeOperation op = [info operation];
  69. NSString *s = [info email];
  70. s = [info previousEmail];
  71. }
  72. - (void)ActionCodeURL:(FIRActionCodeURL *)url {
  73. __unused FIRActionCodeOperation op = [url operation];
  74. NSString *s = [url APIKey];
  75. s = [url code];
  76. __unused NSURL *u = [url continueURL];
  77. s = [url languageCode];
  78. }
  79. - (void)authProperties:(FIRAuth *)auth {
  80. __unused BOOL b = [auth shareAuthStateAcrossDevices];
  81. [auth setShareAuthStateAcrossDevices:YES];
  82. __unused FIRUser *u = [auth currentUser];
  83. NSString *s = [auth languageCode];
  84. [auth setLanguageCode:s];
  85. FIRAuthSettings *settings = [auth settings];
  86. [auth setSettings:settings];
  87. s = [auth userAccessGroup];
  88. s = [auth tenantID];
  89. [auth setTenantID:s];
  90. s = [auth customAuthDomain];
  91. [auth setCustomAuthDomain:s];
  92. #if TARGET_OS_IOS
  93. __unused NSData *d = [auth APNSToken];
  94. // TODO: It seems like a no-op and a bug to have this API in Objective-C
  95. // auth.APNSToken = [[NSData alloc] init];
  96. #endif
  97. }
  98. - (void)FIRAuth_h:(FIRAuth *)auth
  99. with:(FIRAuthCredential *)credential
  100. provider:(FIROAuthProvider *)provider
  101. url:(NSURL *)url {
  102. [auth updateCurrentUser:[auth currentUser]
  103. completion:^(NSError *_Nullable error){
  104. }];
  105. [auth signInWithEmail:@"a@abc.com"
  106. password:@"pw"
  107. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  108. }];
  109. #if !TARGET_OS_WATCH
  110. [auth signInWithEmail:@"a@abc.com"
  111. link:@"link"
  112. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  113. }];
  114. #endif
  115. #if TARGET_OS_IOS
  116. [auth signInWithProvider:provider
  117. UIDelegate:nil
  118. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  119. }];
  120. [auth signInWithCredential:credential
  121. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  122. }];
  123. #endif
  124. [auth signInAnonymouslyWithCompletion:^(FIRAuthDataResult *_Nullable authResult,
  125. NSError *_Nullable error){
  126. }];
  127. [auth signInWithCustomToken:@"token"
  128. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  129. }];
  130. [auth createUserWithEmail:@"a@abc.com"
  131. password:@"pw"
  132. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  133. }];
  134. [auth confirmPasswordResetWithCode:@"code"
  135. newPassword:@"pw"
  136. completion:^(NSError *_Nullable error){
  137. }];
  138. [auth checkActionCode:@"code"
  139. completion:^(FIRActionCodeInfo *_Nullable info, NSError *_Nullable error){
  140. }];
  141. [auth verifyPasswordResetCode:@"code"
  142. completion:^(NSString *_Nullable email, NSError *_Nullable error){
  143. }];
  144. [auth applyActionCode:@"code"
  145. completion:^(NSError *_Nullable error){
  146. }];
  147. [auth sendPasswordResetWithEmail:@"email"
  148. completion:^(NSError *_Nullable error){
  149. }];
  150. FIRActionCodeSettings *settings = [[FIRActionCodeSettings alloc] init];
  151. [auth sendPasswordResetWithEmail:@"email"
  152. actionCodeSettings:settings
  153. completion:^(NSError *_Nullable error){
  154. }];
  155. #if !TARGET_OS_WATCH
  156. [auth sendSignInLinkToEmail:@"email"
  157. actionCodeSettings:settings
  158. completion:^(NSError *_Nullable error){
  159. }];
  160. #endif
  161. NSError *error;
  162. [auth signOut:&error];
  163. __unused BOOL b;
  164. #if !TARGET_OS_WATCH
  165. b = [auth isSignInWithEmailLink:@"email"];
  166. #endif
  167. FIRAuthStateDidChangeListenerHandle handle =
  168. [auth addAuthStateDidChangeListener:^(FIRAuth *_Nonnull auth, FIRUser *_Nullable user){
  169. }];
  170. [auth removeAuthStateDidChangeListener:handle];
  171. [auth removeIDTokenDidChangeListener:handle];
  172. [auth useAppLanguage];
  173. [auth useEmulatorWithHost:@"host" port:123];
  174. #if TARGET_OS_IOS
  175. b = [auth canHandleURL:url];
  176. [auth setAPNSToken:[[NSData alloc] init] type:FIRAuthAPNSTokenTypeProd];
  177. b = [auth canHandleNotification:@{}];
  178. #if !TARGET_OS_MACCATALYST && (!defined(TARGET_OS_VISION) || !TARGET_OS_VISION)
  179. [auth initializeRecaptchaConfigWithCompletion:^(NSError *_Nullable error){
  180. }];
  181. #endif
  182. #endif
  183. [auth revokeTokenWithAuthorizationCode:@"a"
  184. completion:^(NSError *_Nullable error){
  185. }];
  186. [auth useUserAccessGroup:@"abc" error:&error];
  187. __unused FIRUser *u = [auth getStoredUserForAccessGroup:@"user" error:&error];
  188. }
  189. #if !TARGET_OS_OSX
  190. - (void)FIRAuthAPNSTokenType_h {
  191. FIRAuthAPNSTokenType t = FIRAuthAPNSTokenTypeProd;
  192. t = FIRAuthAPNSTokenTypeSandbox;
  193. t = FIRAuthAPNSTokenTypeUnknown;
  194. }
  195. #endif
  196. - (NSString *)authCredential:(FIRAuthCredential *)credential {
  197. return [credential provider];
  198. }
  199. - (void)authDataResult:(FIRAuthDataResult *)result {
  200. __unused FIRUser *u = [result user];
  201. __unused FIRAdditionalUserInfo *info = [result additionalUserInfo];
  202. __unused FIRAuthCredential *c = [result credential];
  203. }
  204. - (void)FIRAuthErrors_h {
  205. FIRAuthErrorCode c = FIRAuthErrorCodeInvalidCustomToken;
  206. c = FIRAuthErrorCodeCustomTokenMismatch;
  207. c = FIRAuthErrorCodeInvalidCredential;
  208. c = FIRAuthErrorCodeUserDisabled;
  209. c = FIRAuthErrorCodeOperationNotAllowed;
  210. c = FIRAuthErrorCodeEmailAlreadyInUse;
  211. c = FIRAuthErrorCodeInvalidEmail;
  212. c = FIRAuthErrorCodeWrongPassword;
  213. c = FIRAuthErrorCodeTooManyRequests;
  214. c = FIRAuthErrorCodeUserNotFound;
  215. c = FIRAuthErrorCodeAccountExistsWithDifferentCredential;
  216. c = FIRAuthErrorCodeRequiresRecentLogin;
  217. c = FIRAuthErrorCodeProviderAlreadyLinked;
  218. c = FIRAuthErrorCodeNoSuchProvider;
  219. c = FIRAuthErrorCodeInvalidUserToken;
  220. c = FIRAuthErrorCodeNetworkError;
  221. c = FIRAuthErrorCodeUserTokenExpired;
  222. c = FIRAuthErrorCodeInvalidAPIKey;
  223. c = FIRAuthErrorCodeUserMismatch;
  224. c = FIRAuthErrorCodeCredentialAlreadyInUse;
  225. c = FIRAuthErrorCodeWeakPassword;
  226. c = FIRAuthErrorCodeAppNotAuthorized;
  227. c = FIRAuthErrorCodeExpiredActionCode;
  228. c = FIRAuthErrorCodeInvalidActionCode;
  229. c = FIRAuthErrorCodeInvalidMessagePayload;
  230. c = FIRAuthErrorCodeInvalidSender;
  231. c = FIRAuthErrorCodeInvalidRecipientEmail;
  232. c = FIRAuthErrorCodeMissingEmail;
  233. c = FIRAuthErrorCodeMissingIosBundleID;
  234. c = FIRAuthErrorCodeMissingAndroidPackageName;
  235. c = FIRAuthErrorCodeUnauthorizedDomain;
  236. c = FIRAuthErrorCodeInvalidContinueURI;
  237. c = FIRAuthErrorCodeMissingContinueURI;
  238. c = FIRAuthErrorCodeMissingPhoneNumber;
  239. c = FIRAuthErrorCodeInvalidPhoneNumber;
  240. c = FIRAuthErrorCodeMissingVerificationCode;
  241. c = FIRAuthErrorCodeInvalidVerificationCode;
  242. c = FIRAuthErrorCodeMissingVerificationID;
  243. c = FIRAuthErrorCodeInvalidVerificationID;
  244. c = FIRAuthErrorCodeMissingAppCredential;
  245. c = FIRAuthErrorCodeInvalidAppCredential;
  246. c = FIRAuthErrorCodeSessionExpired;
  247. c = FIRAuthErrorCodeQuotaExceeded;
  248. c = FIRAuthErrorCodeMissingAppToken;
  249. c = FIRAuthErrorCodeNotificationNotForwarded;
  250. c = FIRAuthErrorCodeAppNotVerified;
  251. c = FIRAuthErrorCodeCaptchaCheckFailed;
  252. c = FIRAuthErrorCodeWebContextAlreadyPresented;
  253. c = FIRAuthErrorCodeWebContextCancelled;
  254. c = FIRAuthErrorCodeAppVerificationUserInteractionFailure;
  255. c = FIRAuthErrorCodeInvalidClientID;
  256. c = FIRAuthErrorCodeWebNetworkRequestFailed;
  257. c = FIRAuthErrorCodeWebInternalError;
  258. c = FIRAuthErrorCodeWebSignInUserInteractionFailure;
  259. c = FIRAuthErrorCodeLocalPlayerNotAuthenticated;
  260. c = FIRAuthErrorCodeNullUser;
  261. c = FIRAuthErrorCodeDynamicLinkNotActivated;
  262. c = FIRAuthErrorCodeInvalidProviderID;
  263. c = FIRAuthErrorCodeTenantIDMismatch;
  264. c = FIRAuthErrorCodeUnsupportedTenantOperation;
  265. c = FIRAuthErrorCodeInvalidDynamicLinkDomain;
  266. c = FIRAuthErrorCodeRejectedCredential;
  267. c = FIRAuthErrorCodeGameKitNotLinked;
  268. c = FIRAuthErrorCodeSecondFactorRequired;
  269. c = FIRAuthErrorCodeMissingMultiFactorSession;
  270. c = FIRAuthErrorCodeMissingMultiFactorInfo;
  271. c = FIRAuthErrorCodeInvalidMultiFactorSession;
  272. c = FIRAuthErrorCodeMultiFactorInfoNotFound;
  273. c = FIRAuthErrorCodeAdminRestrictedOperation;
  274. c = FIRAuthErrorCodeUnverifiedEmail;
  275. c = FIRAuthErrorCodeSecondFactorAlreadyEnrolled;
  276. c = FIRAuthErrorCodeMaximumSecondFactorCountExceeded;
  277. c = FIRAuthErrorCodeUnsupportedFirstFactor;
  278. c = FIRAuthErrorCodeEmailChangeNeedsVerification;
  279. c = FIRAuthErrorCodeMissingClientIdentifier;
  280. c = FIRAuthErrorCodeMissingOrInvalidNonce;
  281. c = FIRAuthErrorCodeBlockingCloudFunctionError;
  282. c = FIRAuthErrorCodeRecaptchaNotEnabled;
  283. c = FIRAuthErrorCodeMissingRecaptchaToken;
  284. c = FIRAuthErrorCodeInvalidRecaptchaToken;
  285. c = FIRAuthErrorCodeInvalidRecaptchaAction;
  286. c = FIRAuthErrorCodeMissingClientType;
  287. c = FIRAuthErrorCodeMissingRecaptchaVersion;
  288. c = FIRAuthErrorCodeInvalidRecaptchaVersion;
  289. c = FIRAuthErrorCodeInvalidReqType;
  290. c = FIRAuthErrorCodeRecaptchaSDKNotLinked;
  291. c = FIRAuthErrorCodeKeychainError;
  292. c = FIRAuthErrorCodeInternalError;
  293. c = FIRAuthErrorCodeMalformedJWT;
  294. }
  295. - (void)authSettings:(FIRAuthSettings *)settings {
  296. BOOL b = [settings isAppVerificationDisabledForTesting];
  297. [settings setAppVerificationDisabledForTesting:b];
  298. }
  299. - (void)authTokenResult:(FIRAuthTokenResult *)result {
  300. NSString *s = [result token];
  301. NSDate *d = [result expirationDate];
  302. d = [result authDate];
  303. d = [result issuedAtDate];
  304. s = [result signInProvider];
  305. s = [result signInSecondFactor];
  306. __unused NSDictionary<NSString *, NSObject *> *dict = [result claims];
  307. }
  308. #if !TARGET_OS_OSX && !TARGET_OS_WATCH
  309. - (void)authTokenResult {
  310. AuthUIImpl *impl = [[AuthUIImpl alloc] init];
  311. [impl presentViewController:[[UIViewController alloc] init]
  312. animated:NO
  313. completion:^{
  314. }];
  315. [impl dismissViewControllerAnimated:YES
  316. completion:^{
  317. }];
  318. }
  319. #endif
  320. - (void)FIREmailAuthProvider_h {
  321. FIRAuthCredential *c = [FIREmailAuthProvider credentialWithEmail:@"e" password:@"pw"];
  322. c = [FIREmailAuthProvider credentialWithEmail:@"e" link:@"l"];
  323. }
  324. - (void)FIRFacebookAuthProvider_h {
  325. __unused FIRAuthCredential *c = [FIRFacebookAuthProvider credentialWithAccessToken:@"token"];
  326. }
  327. #if TARGET_OS_IOS
  328. - (void)FIRFederatedAuthProvider_h {
  329. FederatedAuthImplementation *impl = [[FederatedAuthImplementation alloc] init];
  330. [impl getCredentialWithUIDelegate:nil
  331. completion:^(FIRAuthCredential *_Nullable c, NSError *_Nullable e){
  332. }];
  333. }
  334. #endif
  335. #if !TARGET_OS_WATCH
  336. - (void)FIRGameCenterAuthProvider_h {
  337. [FIRGameCenterAuthProvider getCredentialWithCompletion:^(FIRAuthCredential *_Nullable credential,
  338. NSError *_Nullable error){
  339. }];
  340. }
  341. #endif
  342. - (void)FIRGitHubAuthProvider_h {
  343. __unused FIRAuthCredential *c = [FIRGitHubAuthProvider credentialWithToken:@"token"];
  344. }
  345. - (void)FIRGoogleAuthProvider_h {
  346. __unused FIRAuthCredential *c = [FIRGoogleAuthProvider credentialWithIDToken:@"token"
  347. accessToken:@"token"];
  348. }
  349. #if TARGET_OS_IOS
  350. - (void)FIRMultiFactor_h:(FIRMultiFactor *)mf mfa:(FIRMultiFactorAssertion *)mfa {
  351. [mf getSessionWithCompletion:^(FIRMultiFactorSession *_Nullable credential,
  352. NSError *_Nullable error){
  353. }];
  354. [mf enrollWithAssertion:mfa
  355. displayName:@"name"
  356. completion:^(NSError *_Nullable error){
  357. }];
  358. FIRMultiFactorInfo *mfi = [mf enrolledFactors][0];
  359. [mf unenrollWithInfo:mfi
  360. completion:^(NSError *_Nullable error){
  361. }];
  362. [mf unenrollWithFactorUID:@"uid"
  363. completion:^(NSError *_Nullable error){
  364. }];
  365. }
  366. - (void)multiFactorAssertion:(FIRMultiFactorAssertion *)mfa {
  367. __unused NSString *s = [mfa factorID];
  368. }
  369. - (void)multiFactorInfo:(FIRMultiFactorInfo *)mfi {
  370. NSString *s = [mfi UID];
  371. s = [mfi factorID];
  372. s = [mfi displayName];
  373. __unused NSDate *d = [mfi enrollmentDate];
  374. }
  375. - (void)multiFactorResolver:(FIRMultiFactorResolver *)mfr {
  376. __unused FIRMultiFactorSession *s = [mfr session];
  377. __unused NSArray<FIRMultiFactorInfo *> *hints = [mfr hints];
  378. __unused FIRAuth *auth = [mfr auth];
  379. }
  380. #endif
  381. - (void)oauthCredential:(FIROAuthCredential *)credential {
  382. NSString *s = [credential IDToken];
  383. s = [credential accessToken];
  384. s = [credential secret];
  385. }
  386. #if TARGET_OS_IOS
  387. - (void)FIROAuthProvider_h:(FIROAuthProvider *)provider {
  388. FIROAuthProvider *p = [FIROAuthProvider providerWithProviderID:@""];
  389. p = [FIROAuthProvider providerWithProviderID:@"" auth:[FIRAuth auth]];
  390. FIROAuthCredential *c = [FIROAuthProvider credentialWithProviderID:@"id" accessToken:@"token"];
  391. c = [FIROAuthProvider credentialWithProviderID:@"id"
  392. IDToken:@"idToken"
  393. accessToken:@"accessToken"];
  394. c = [FIROAuthProvider credentialWithProviderID:@"id" IDToken:@"idtoken" rawNonce:@"nonce"];
  395. c = [FIROAuthProvider credentialWithProviderID:@"id"
  396. IDToken:@"token"
  397. rawNonce:@"nonce"
  398. accessToken:@"accessToken"];
  399. c = [FIROAuthProvider appleCredentialWithIDToken:@"idToken" rawNonce:@"nonce" fullName:nil];
  400. [provider getCredentialWithUIDelegate:nil
  401. completion:^(FIRAuthCredential *_Nullable credential,
  402. NSError *_Nullable error){
  403. }];
  404. __unused NSString *s = [provider providerID];
  405. __unused NSArray<NSString *> *scopes = [provider scopes];
  406. __unused NSDictionary<NSString *, NSString *> *params = [provider customParameters];
  407. }
  408. - (void)FIRPhoneAuthProvider_h:(FIRPhoneAuthProvider *)provider mfi:(FIRPhoneMultiFactorInfo *)mfi {
  409. [provider verifyPhoneNumber:@"123"
  410. UIDelegate:nil
  411. completion:^(NSString *_Nullable verificationID, NSError *_Nullable error){
  412. }];
  413. [provider verifyPhoneNumber:@"123"
  414. UIDelegate:nil
  415. multiFactorSession:nil
  416. completion:^(NSString *_Nullable verificationID, NSError *_Nullable error){
  417. }];
  418. [provider verifyPhoneNumberWithMultiFactorInfo:mfi
  419. UIDelegate:nil
  420. multiFactorSession:nil
  421. completion:^(NSString *_Nullable verificationID,
  422. NSError *_Nullable error){
  423. }];
  424. __unused FIRPhoneAuthCredential *c = [provider credentialWithVerificationID:@"id"
  425. verificationCode:@"code"];
  426. }
  427. - (void)FIRPhoneAuthProvider_h:(FIRPhoneAuthCredential *)credential {
  428. __unused FIRPhoneMultiFactorAssertion *a =
  429. [FIRPhoneMultiFactorGenerator assertionWithCredential:credential];
  430. }
  431. - (void)phoneMultiFactorInfo:(FIRPhoneMultiFactorInfo *)info {
  432. __unused NSString *s = [info phoneNumber];
  433. }
  434. - (void)FIRTOTPSecret_h:(FIRTOTPSecret *)secret {
  435. NSString *s = [secret sharedSecretKey];
  436. s = [secret generateQRCodeURLWithAccountName:@"name" issuer:@"issuer"];
  437. [secret openInOTPAppWithQRCodeURL:@"qr"];
  438. }
  439. - (void)FIRTOTPMultiFactorGenerator_h:(FIRMultiFactorSession *)session
  440. secret:(FIRTOTPSecret *)secret {
  441. [FIRTOTPMultiFactorGenerator
  442. generateSecretWithMultiFactorSession:session
  443. completion:^(FIRTOTPSecret *_Nullable secret,
  444. NSError *_Nullable error){
  445. }];
  446. FIRTOTPMultiFactorAssertion *a =
  447. [FIRTOTPMultiFactorGenerator assertionForEnrollmentWithSecret:secret oneTimePassword:@"pw"];
  448. a = [FIRTOTPMultiFactorGenerator assertionForSignInWithEnrollmentID:@"id" oneTimePassword:@"pw"];
  449. }
  450. #endif
  451. - (void)FIRTwitterAuthProvider_h {
  452. __unused FIRAuthCredential *c = [FIRTwitterAuthProvider credentialWithToken:@"token"
  453. secret:@"secret"];
  454. }
  455. - (void)FIRUser_h:(FIRUser *)user credential:(FIRAuthCredential *)credential {
  456. [user updatePassword:@"pw"
  457. completion:^(NSError *_Nullable error){
  458. }];
  459. [user reloadWithCompletion:^(NSError *_Nullable error){
  460. }];
  461. [user reauthenticateWithCredential:credential
  462. completion:^(FIRAuthDataResult *_Nullable authResult,
  463. NSError *_Nullable error){
  464. }];
  465. #if TARGET_OS_IOS
  466. FIRPhoneAuthProvider *provider = [FIRPhoneAuthProvider provider];
  467. FIRPhoneAuthCredential *phoneCredential = [provider credentialWithVerificationID:@"id"
  468. verificationCode:@"code"];
  469. [user updatePhoneNumberCredential:phoneCredential
  470. completion:^(NSError *_Nullable error){
  471. }];
  472. [user reauthenticateWithProvider:(NSObject<FIRFederatedAuthProvider> *)provider
  473. UIDelegate:nil
  474. completion:^(FIRAuthDataResult *_Nullable authResult,
  475. NSError *_Nullable error){
  476. }];
  477. [user linkWithProvider:(NSObject<FIRFederatedAuthProvider> *)provider
  478. UIDelegate:nil
  479. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  480. }];
  481. #endif
  482. [user getIDTokenResultWithCompletion:^(FIRAuthTokenResult *_Nullable tokenResult,
  483. NSError *_Nullable error){
  484. }];
  485. [user getIDTokenResultForcingRefresh:YES
  486. completion:^(FIRAuthTokenResult *_Nullable tokenResult,
  487. NSError *_Nullable error){
  488. }];
  489. [user getIDTokenWithCompletion:^(NSString *_Nullable token, NSError *_Nullable error){
  490. }];
  491. [user getIDTokenForcingRefresh:NO
  492. completion:^(NSString *_Nullable token, NSError *_Nullable error){
  493. }];
  494. [user linkWithCredential:credential
  495. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  496. }];
  497. [user unlinkFromProvider:@"provider"
  498. completion:^(FIRUser *_Nullable user, NSError *_Nullable error){
  499. }];
  500. [user sendEmailVerificationWithCompletion:^(NSError *_Nullable error){
  501. }];
  502. [user sendEmailVerificationBeforeUpdatingEmail:@"email"
  503. completion:^(NSError *_Nullable error){
  504. }];
  505. FIRActionCodeSettings *settings = [[FIRActionCodeSettings alloc] init];
  506. [user sendEmailVerificationWithActionCodeSettings:settings
  507. completion:^(NSError *_Nullable error){
  508. }];
  509. [user sendEmailVerificationBeforeUpdatingEmail:@"email"
  510. actionCodeSettings:settings
  511. completion:^(NSError *_Nullable error){
  512. }];
  513. [user deleteWithCompletion:^(NSError *_Nullable error){
  514. }];
  515. FIRUserProfileChangeRequest *changeRequest = [user profileChangeRequest];
  516. [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error){
  517. }];
  518. NSString *s = [user providerID];
  519. s = [user uid];
  520. s = [user displayName];
  521. s = [user email];
  522. s = [user phoneNumber];
  523. s = [changeRequest displayName];
  524. NSURL *u = [changeRequest photoURL];
  525. u = [user photoURL];
  526. [changeRequest setDisplayName:s];
  527. [changeRequest setPhotoURL:u];
  528. }
  529. - (void)userProperties:(FIRUser *)user {
  530. BOOL b = [user isAnonymous];
  531. b = [user isEmailVerified];
  532. __unused NSArray<NSObject<FIRUserInfo> *> *userInfo = [user providerData];
  533. __unused FIRUserMetadata *meta = [user metadata];
  534. #if TARGET_OS_IOS
  535. __unused FIRMultiFactor *mf = [user multiFactor];
  536. #endif
  537. NSString *s = [user refreshToken];
  538. s = [user tenantID];
  539. FIRUserProfileChangeRequest *changeRequest = [user profileChangeRequest];
  540. s = [changeRequest displayName];
  541. NSURL *u = [changeRequest photoURL];
  542. [changeRequest setDisplayName:s];
  543. [changeRequest setPhotoURL:u];
  544. }
  545. - (void)userInfoProperties:(NSObject<FIRUserInfo> *)userInfo {
  546. NSString *s = [userInfo providerID];
  547. s = [userInfo uid];
  548. s = [userInfo displayName];
  549. s = [userInfo email];
  550. s = [userInfo phoneNumber];
  551. __unused NSURL *u = [userInfo photoURL];
  552. }
  553. - (void)userMetadataProperties:(FIRUserMetadata *)metadata {
  554. NSDate *d = [metadata lastSignInDate];
  555. d = [metadata creationDate];
  556. }
  557. @end