ObjCAPITests.m 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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 linkDomain];
  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 = FIRAuthErrorCodeInvalidProviderID;
  262. c = FIRAuthErrorCodeTenantIDMismatch;
  263. c = FIRAuthErrorCodeUnsupportedTenantOperation;
  264. c = FIRAuthErrorCodeInvalidHostingLinkDomain;
  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. FIROAuthProvider *p = [FIROAuthProvider providerWithProviderID:@""];
  388. p = [FIROAuthProvider providerWithProviderID:@"" auth:[FIRAuth auth]];
  389. FIROAuthCredential *c = [FIROAuthProvider credentialWithProviderID:@"id" accessToken:@"token"];
  390. c = [FIROAuthProvider credentialWithProviderID:@"id"
  391. IDToken:@"idToken"
  392. accessToken:@"accessToken"];
  393. c = [FIROAuthProvider credentialWithProviderID:@"id" IDToken:@"idtoken" rawNonce:@"nonce"];
  394. c = [FIROAuthProvider credentialWithProviderID:@"id"
  395. IDToken:@"token"
  396. rawNonce:@"nonce"
  397. accessToken:@"accessToken"];
  398. c = [FIROAuthProvider appleCredentialWithIDToken:@"idToken" rawNonce:@"nonce" fullName:nil];
  399. [provider getCredentialWithUIDelegate:nil
  400. completion:^(FIRAuthCredential *_Nullable credential,
  401. NSError *_Nullable error){
  402. }];
  403. __unused NSString *s = [provider providerID];
  404. __unused NSArray<NSString *> *scopes = [provider scopes];
  405. __unused NSDictionary<NSString *, NSString *> *params = [provider customParameters];
  406. }
  407. - (void)FIRPhoneAuthProvider_h:(FIRPhoneAuthProvider *)provider mfi:(FIRPhoneMultiFactorInfo *)mfi {
  408. [provider verifyPhoneNumber:@"123"
  409. UIDelegate:nil
  410. completion:^(NSString *_Nullable verificationID, NSError *_Nullable error){
  411. }];
  412. [provider verifyPhoneNumber:@"123"
  413. UIDelegate:nil
  414. multiFactorSession:nil
  415. completion:^(NSString *_Nullable verificationID, NSError *_Nullable error){
  416. }];
  417. [provider verifyPhoneNumberWithMultiFactorInfo:mfi
  418. UIDelegate:nil
  419. multiFactorSession:nil
  420. completion:^(NSString *_Nullable verificationID,
  421. NSError *_Nullable error){
  422. }];
  423. __unused FIRPhoneAuthCredential *c = [provider credentialWithVerificationID:@"id"
  424. verificationCode:@"code"];
  425. }
  426. - (void)FIRPhoneAuthProvider_h:(FIRPhoneAuthCredential *)credential {
  427. __unused FIRPhoneMultiFactorAssertion *a =
  428. [FIRPhoneMultiFactorGenerator assertionWithCredential:credential];
  429. }
  430. - (void)phoneMultiFactorInfo:(FIRPhoneMultiFactorInfo *)info {
  431. __unused NSString *s = [info phoneNumber];
  432. }
  433. - (void)FIRTOTPSecret_h:(FIRTOTPSecret *)secret {
  434. NSString *s = [secret sharedSecretKey];
  435. s = [secret generateQRCodeURLWithAccountName:@"name" issuer:@"issuer"];
  436. [secret openInOTPAppWithQRCodeURL:@"qr"];
  437. }
  438. - (void)FIRTOTPMultiFactorGenerator_h:(FIRMultiFactorSession *)session
  439. secret:(FIRTOTPSecret *)secret {
  440. [FIRTOTPMultiFactorGenerator
  441. generateSecretWithMultiFactorSession:session
  442. completion:^(FIRTOTPSecret *_Nullable secret,
  443. NSError *_Nullable error){
  444. }];
  445. FIRTOTPMultiFactorAssertion *a =
  446. [FIRTOTPMultiFactorGenerator assertionForEnrollmentWithSecret:secret oneTimePassword:@"pw"];
  447. a = [FIRTOTPMultiFactorGenerator assertionForSignInWithEnrollmentID:@"id" oneTimePassword:@"pw"];
  448. }
  449. #endif
  450. - (void)FIRTwitterAuthProvider_h {
  451. __unused FIRAuthCredential *c = [FIRTwitterAuthProvider credentialWithToken:@"token"
  452. secret:@"secret"];
  453. }
  454. - (void)FIRUser_h:(FIRUser *)user credential:(FIRAuthCredential *)credential {
  455. [user updatePassword:@"pw"
  456. completion:^(NSError *_Nullable error){
  457. }];
  458. [user reloadWithCompletion:^(NSError *_Nullable error){
  459. }];
  460. [user reauthenticateWithCredential:credential
  461. completion:^(FIRAuthDataResult *_Nullable authResult,
  462. NSError *_Nullable error){
  463. }];
  464. #if TARGET_OS_IOS
  465. FIRPhoneAuthProvider *provider = [FIRPhoneAuthProvider provider];
  466. FIRPhoneAuthCredential *phoneCredential = [provider credentialWithVerificationID:@"id"
  467. verificationCode:@"code"];
  468. [user updatePhoneNumberCredential:phoneCredential
  469. completion:^(NSError *_Nullable error){
  470. }];
  471. [user reauthenticateWithProvider:(NSObject<FIRFederatedAuthProvider> *)provider
  472. UIDelegate:nil
  473. completion:^(FIRAuthDataResult *_Nullable authResult,
  474. NSError *_Nullable error){
  475. }];
  476. [user linkWithProvider:(NSObject<FIRFederatedAuthProvider> *)provider
  477. UIDelegate:nil
  478. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  479. }];
  480. #endif
  481. [user getIDTokenResultWithCompletion:^(FIRAuthTokenResult *_Nullable tokenResult,
  482. NSError *_Nullable error){
  483. }];
  484. [user getIDTokenResultForcingRefresh:YES
  485. completion:^(FIRAuthTokenResult *_Nullable tokenResult,
  486. NSError *_Nullable error){
  487. }];
  488. [user getIDTokenWithCompletion:^(NSString *_Nullable token, NSError *_Nullable error){
  489. }];
  490. [user getIDTokenForcingRefresh:NO
  491. completion:^(NSString *_Nullable token, NSError *_Nullable error){
  492. }];
  493. [user linkWithCredential:credential
  494. completion:^(FIRAuthDataResult *_Nullable authResult, NSError *_Nullable error){
  495. }];
  496. [user unlinkFromProvider:@"provider"
  497. completion:^(FIRUser *_Nullable user, NSError *_Nullable error){
  498. }];
  499. [user sendEmailVerificationWithCompletion:^(NSError *_Nullable error){
  500. }];
  501. [user sendEmailVerificationBeforeUpdatingEmail:@"email"
  502. completion:^(NSError *_Nullable error){
  503. }];
  504. FIRActionCodeSettings *settings = [[FIRActionCodeSettings alloc] init];
  505. [user sendEmailVerificationWithActionCodeSettings:settings
  506. completion:^(NSError *_Nullable error){
  507. }];
  508. [user sendEmailVerificationBeforeUpdatingEmail:@"email"
  509. actionCodeSettings:settings
  510. completion:^(NSError *_Nullable error){
  511. }];
  512. [user deleteWithCompletion:^(NSError *_Nullable error){
  513. }];
  514. FIRUserProfileChangeRequest *changeRequest = [user profileChangeRequest];
  515. [changeRequest commitChangesWithCompletion:^(NSError *_Nullable error){
  516. }];
  517. NSString *s = [user providerID];
  518. s = [user uid];
  519. s = [user displayName];
  520. s = [user email];
  521. s = [user phoneNumber];
  522. s = [changeRequest displayName];
  523. NSURL *u = [changeRequest photoURL];
  524. u = [user photoURL];
  525. [changeRequest setDisplayName:s];
  526. [changeRequest setPhotoURL:u];
  527. }
  528. - (void)userProperties:(FIRUser *)user {
  529. BOOL b = [user isAnonymous];
  530. b = [user isEmailVerified];
  531. __unused NSArray<NSObject<FIRUserInfo> *> *userInfo = [user providerData];
  532. __unused FIRUserMetadata *meta = [user metadata];
  533. #if TARGET_OS_IOS
  534. __unused FIRMultiFactor *mf = [user multiFactor];
  535. #endif
  536. NSString *s = [user refreshToken];
  537. s = [user tenantID];
  538. FIRUserProfileChangeRequest *changeRequest = [user profileChangeRequest];
  539. s = [changeRequest displayName];
  540. NSURL *u = [changeRequest photoURL];
  541. [changeRequest setDisplayName:s];
  542. [changeRequest setPhotoURL:u];
  543. }
  544. - (void)userInfoProperties:(NSObject<FIRUserInfo> *)userInfo {
  545. NSString *s = [userInfo providerID];
  546. s = [userInfo uid];
  547. s = [userInfo displayName];
  548. s = [userInfo email];
  549. s = [userInfo phoneNumber];
  550. __unused NSURL *u = [userInfo photoURL];
  551. }
  552. - (void)userMetadataProperties:(FIRUserMetadata *)metadata {
  553. NSDate *d = [metadata lastSignInDate];
  554. d = [metadata creationDate];
  555. }
  556. @end