ObjCAPITests.m 23 KB

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