ObjCAPITests.m 24 KB

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