Skip to content

Commit 36860d6

Browse files
author
Chuan Ren
authored
Resolve deprecations warnings (#683)
1 parent 6812dd5 commit 36860d6

File tree

18 files changed

+72
-72
lines changed

18 files changed

+72
-72
lines changed

Auth/FirebaseAuthUI/AccountManagement/FUIAccountSettingsOperation.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ - (void)reauthenticateWithProvider:(NSString *)providerID
180180
return;
181181
}
182182
[self.delegate.auth.currentUser
183-
reauthenticateAndRetrieveDataWithCredential:credential
184-
completion:^(FIRAuthDataResult *_Nullable authResult,
185-
NSError *_Nullable reauthError) {
183+
reauthenticateWithCredential:credential
184+
completion:^(FIRAuthDataResult *_Nullable authResult,
185+
NSError *_Nullable reauthError) {
186186
[self.delegate decrementActivity];
187187
if (result) {
188188
result(self.delegate.auth.currentUser, reauthError);

Auth/FirebaseAuthUI/FUIAuth.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ - (void)signInWithProviderUI:(id<FUIAuthProvider>)providerUI
197197
credential:credential
198198
resultCallback:result];
199199
} else {
200-
[self.auth signInAndRetrieveDataWithCredential:credential
201-
completion:^(FIRAuthDataResult *_Nullable authResult,
202-
NSError *_Nullable error) {
200+
[self.auth signInWithCredential:credential
201+
completion:^(FIRAuthDataResult *_Nullable authResult,
202+
NSError *_Nullable error) {
203203
if (error && error.code == FIRAuthErrorCodeAccountExistsWithDifferentCredential) {
204204
NSString *email = error.userInfo[kErrorUserInfoEmailKey];
205205
[self.emailAuthProvider handleAccountLinkingForEmail:email
@@ -230,9 +230,9 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
230230
credential:(nullable FIRAuthCredential *)credential
231231
resultCallback:(nullable FIRAuthResultCallback)callback {
232232
[self.auth.currentUser
233-
linkAndRetrieveDataWithCredential:credential
234-
completion:^(FIRAuthDataResult *_Nullable authResult,
235-
NSError * _Nullable error) {
233+
linkWithCredential:credential
234+
completion:^(FIRAuthDataResult *_Nullable authResult,
235+
NSError * _Nullable error) {
236236
if (error) {
237237
// Check for "credential in use" conflict error and handle appropriately.
238238
if (error.code == FIRAuthErrorCodeCredentialAlreadyInUse) {
@@ -283,9 +283,9 @@ - (void)autoUpgradeAccountWithProviderUI:(id<FUIAuthProvider>)providerUI
283283
return;
284284
}
285285

286-
[authResult.user linkAndRetrieveDataWithCredential:credential
287-
completion:^(FIRAuthDataResult *authResult,
288-
NSError *linkError) {
286+
[authResult.user linkWithCredential:credential
287+
completion:^(FIRAuthDataResult *authResult,
288+
NSError *linkError) {
289289
if (linkError) {
290290
[self completeSignInWithResult:nil
291291
error:linkError

Auth/FirebaseAuthUI/FUIAuthUtils.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import <UIKit/UIKit.h>
1818

19+
NS_ASSUME_NONNULL_BEGIN
20+
1921
/* Name of the FirebaseAuthUI resource bundle. */
2022
extern NSString *const FUIAuthBundleName;
2123

@@ -31,22 +33,24 @@ extern NSString *const FUIAuthBundleName;
3133
@param bundleName Name of the bundle to retreive. If nil, this returns the default bundle for
3234
FirebaseUI.
3335
*/
34-
+ (NSBundle *)bundleNamed:(nullable NSString *)bundleName;
36+
+ (nullable NSBundle *)bundleNamed:(nullable NSString *)bundleName;
3537

3638
/** @fn imageNamed:fromBundle:
3739
@brief Gets a UIImage with the given name, assuming it's a png.
3840
@param name Name of the image to retreive.
3941
@param bundleNameOrNil Name of the bundle to retreive. If nil, this method will look into the
4042
default FirebaseUI framework bundle.
4143
*/
42-
+ (UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString *)bundleNameOrNil;
44+
+ (nullable UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString *)bundleNameOrNil;
4345

4446
/** @fn imageNamed:fromBundle:
4547
@brief Gets a UIImage with the given name, assuming it's a png.
4648
@param name Name of the image to retreive.
4749
@param bundle The bundle to retrieve the image from. If nil, this method will look into the
4850
default FirebaseUI framework bundle.
4951
*/
50-
+ (UIImage *)imageNamed:(NSString *)name fromBundle:(nullable NSBundle *)bundle;
52+
+ (nullable UIImage *)imageNamed:(NSString *)name fromBundle:(nullable NSBundle *)bundle;
5153

5254
@end
55+
56+
NS_ASSUME_NONNULL_END

Auth/FirebaseAuthUI/FUIAuthUtils.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
@implementation FUIAuthUtils
2222

23-
+ (NSBundle *)bundleNamed:(NSString *)bundleName {
23+
+ (nullable NSBundle *)bundleNamed:(nullable NSString *)bundleName {
2424
NSBundle *frameworkBundle = nil;
2525
if (!bundleName) {
2626
bundleName = FUIAuthBundleName;
@@ -37,7 +37,7 @@ + (NSBundle *)bundleNamed:(NSString *)bundleName {
3737
return frameworkBundle;
3838
}
3939

40-
+ (UIImage *)imageNamed:(NSString *)name fromBundle:(NSBundle *)bundle {
40+
+ (nullable UIImage *)imageNamed:(NSString *)name fromBundle:(nullable NSBundle *)bundle {
4141
if (!bundle) {
4242
bundle = [self bundleNamed:nil];
4343
}
@@ -48,7 +48,7 @@ + (UIImage *)imageNamed:(NSString *)name fromBundle:(NSBundle *)bundle {
4848
return [UIImage imageWithContentsOfFile:path];
4949
}
5050

51-
+ (UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString *)bundleNameOrNil {
51+
+ (nullable UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString *)bundleNameOrNil {
5252
NSString *path = [[FUIAuthUtils bundleNamed:bundleNameOrNil] pathForResource:name ofType:@"png"];
5353
if (!path) {
5454
NSLog(@"Warning: Unable to find asset %@ in bundle named %@.", name, bundleNameOrNil);

EmailAuth/FirebaseEmailAuthUI/FUIConfirmEmailViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ - (void)onNext:(NSString *)emailText {
183183
presentingViewController:self];
184184
};
185185

186-
[self.auth signInAndRetrieveDataWithCredential:credential completion:completeSignInBlock];
186+
[self.auth signInWithCredential:credential completion:completeSignInBlock];
187187
}
188188

189189
- (void)textFieldDidChange {
@@ -280,9 +280,9 @@ - (void)signInWithProvider:(id<FUIAuthProvider>)provider email:(NSString *)email
280280
return;
281281
}
282282

283-
[self.auth signInAndRetrieveDataWithCredential:credential
284-
completion:^(FIRAuthDataResult *_Nullable authResult,
285-
NSError *_Nullable error) {
283+
[self.auth signInWithCredential:credential
284+
completion:^(FIRAuthDataResult *_Nullable authResult,
285+
NSError *_Nullable error) {
286286
[self decrementActivity];
287287
if (result) {
288288
result(authResult.user, error);

EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,15 @@ - (void)handleUnverifiedProviderLinking:(NSString *)providerID
330330
presentingViewController:nil];
331331
};
332332

333-
[self.authUI.auth signInAndRetrieveDataWithCredential:emailLinkCredential
334-
completion:^(FIRAuthDataResult * _Nullable authResult, NSError * _Nullable error) {
333+
[self.authUI.auth signInWithCredential:emailLinkCredential
334+
completion:^(FIRAuthDataResult * _Nullable authResult,
335+
NSError * _Nullable error) {
335336
if (error) {
336337
[FUIAuthBaseViewController showAlertWithMessage:error.description];
337338
return;
338339
}
339340

340-
[authResult.user linkAndRetrieveDataWithCredential:unverifiedProviderCredential completion:completeSignInBlock];
341+
[authResult.user linkWithCredential:unverifiedProviderCredential completion:completeSignInBlock];
341342
}];
342343
}
343344
}
@@ -373,9 +374,9 @@ - (void)handleAnonymousUpgrade:(NSString *)anonymousUserID email:(NSString *)ema
373374
};
374375

375376
[self.authUI.auth.currentUser
376-
linkAndRetrieveDataWithCredential:credential
377-
completion:^(FIRAuthDataResult *_Nullable authResult,
378-
NSError *_Nullable error) {
377+
linkWithCredential:credential
378+
completion:^(FIRAuthDataResult *_Nullable authResult,
379+
NSError *_Nullable error) {
379380
if (error) {
380381
if (error.code == FIRAuthErrorCodeEmailAlreadyInUse) {
381382
NSDictionary *userInfo = @{ FUIAuthCredentialKey : credential };
@@ -434,7 +435,7 @@ - (void)handleEmaiLinkSignIn:(NSString *)email {
434435
presentingViewController:nil];
435436
};
436437

437-
[self.authUI.auth signInAndRetrieveDataWithCredential:credential completion:completeSignInBlock];
438+
[self.authUI.auth signInWithCredential:credential completion:completeSignInBlock];
438439
}
439440

440441
- (void)handleDifferentDevice {
@@ -571,9 +572,9 @@ - (void)signInWithEmailHint:(NSString *)emailHint
571572
return;
572573
}
573574

574-
[tempAuth signInAndRetrieveDataWithCredential:credential
575-
completion:^(FIRAuthDataResult *_Nullable authResult,
576-
NSError *_Nullable error) {
575+
[tempAuth signInWithCredential:credential
576+
completion:^(FIRAuthDataResult *_Nullable authResult,
577+
NSError *_Nullable error) {
577578
if (error) {
578579
if (completion) {
579580
completion(nil, error, nil);
@@ -759,9 +760,9 @@ - (void)handleAccountLinkingForEmail:(NSString *)email
759760
return;
760761
}
761762

762-
[self.authUI.auth signInAndRetrieveDataWithCredential:credential
763-
completion:^(FIRAuthDataResult*_Nullable authResult,
764-
NSError *_Nullable error) {
763+
[self.authUI.auth signInWithCredential:credential
764+
completion:^(FIRAuthDataResult*_Nullable authResult,
765+
NSError *_Nullable error) {
765766
if (error) {
766767
[self.authUI invokeResultCallbackWithAuthDataResult:nil URL:nil error:error];
767768
if (result) {
@@ -771,9 +772,9 @@ - (void)handleAccountLinkingForEmail:(NSString *)email
771772
}
772773

773774
FIRUser *user = authResult.user;
774-
[user linkAndRetrieveDataWithCredential:newCredential
775-
completion:^(FIRAuthDataResult *_Nullable authResult,
776-
NSError *_Nullable error) {
775+
[user linkWithCredential:newCredential
776+
completion:^(FIRAuthDataResult *_Nullable authResult,
777+
NSError *_Nullable error) {
777778
if (result) {
778779
result(authResult.user, error);
779780
}

EmailAuth/FirebaseEmailAuthUI/FUIEmailEntryViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ - (void)signInWithProvider:(id<FUIAuthProvider>)provider email:(NSString *)email
353353
return;
354354
}
355355

356-
[self.auth signInAndRetrieveDataWithCredential:credential
357-
completion:^(FIRAuthDataResult *_Nullable authResult,
358-
NSError *_Nullable error) {
356+
[self.auth signInWithCredential:credential
357+
completion:^(FIRAuthDataResult *_Nullable authResult,
358+
NSError *_Nullable error) {
359359
[self decrementActivity];
360360
if (result) {
361361
result(authResult.user, error);

EmailAuth/FirebaseEmailAuthUI/FUIPasswordSignInViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ - (void)signInWithDefaultValue:(NSString *)email andPassword:(NSString *)passwor
179179
// Check for the presence of an anonymous user and whether automatic upgrade is enabled.
180180
if (self.auth.currentUser.isAnonymous && self.authUI.shouldAutoUpgradeAnonymousUsers) {
181181
[self.auth.currentUser
182-
linkAndRetrieveDataWithCredential:credential
183-
completion:^(FIRAuthDataResult *_Nullable authResult,
184-
NSError *_Nullable error) {
182+
linkWithCredential:credential
183+
completion:^(FIRAuthDataResult *_Nullable authResult,
184+
NSError *_Nullable error) {
185185
if (error) {
186186
if (error.code == FIRAuthErrorCodeEmailAlreadyInUse) {
187187
NSDictionary *userInfo = @{ FUIAuthCredentialKey : credential };
@@ -196,7 +196,7 @@ - (void)signInWithDefaultValue:(NSString *)email andPassword:(NSString *)passwor
196196
completeSignInBlock(authResult, nil);
197197
}];
198198
} else {
199-
[self.auth signInAndRetrieveDataWithCredential:credential completion:completeSignInBlock];
199+
[self.auth signInWithCredential:credential completion:completeSignInBlock];
200200
}
201201
}
202202

EmailAuth/FirebaseEmailAuthUI/FUIPasswordSignUpViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ - (void)signUpWithEmail:(NSString *)email
163163
FIRAuthCredential *credential =
164164
[FIREmailAuthProvider credentialWithEmail:email password:password];
165165
[self.auth.currentUser
166-
linkAndRetrieveDataWithCredential:credential
167-
completion:^(FIRAuthDataResult *_Nullable authResult,
168-
NSError * _Nullable error) {
166+
linkWithCredential:credential
167+
completion:^(FIRAuthDataResult *_Nullable authResult,
168+
NSError * _Nullable error) {
169169
if (error) {
170170
[self decrementActivity];
171171
[self finishSignUpWithAuthDataResult:nil error:error];

EmailAuth/FirebaseEmailAuthUI/FUIPasswordVerificationViewController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,19 @@ - (void)verifyPassword:(NSString *)password {
153153

154154
FIRAuthCredential *credential =
155155
[FIREmailAuthProvider credentialWithEmail:_email password:password];
156-
[self.auth signInAndRetrieveDataWithCredential:credential
157-
completion:^(FIRAuthDataResult *_Nullable authResult,
158-
NSError *_Nullable error) {
156+
[self.auth signInWithCredential:credential
157+
completion:^(FIRAuthDataResult *_Nullable authResult,
158+
NSError *_Nullable error) {
159159
if (error) {
160160
[self decrementActivity];
161161

162162
[self showAlertWithMessage:FUILocalizedString(kStr_WrongPasswordError)];
163163
return;
164164
}
165165

166-
[authResult.user linkAndRetrieveDataWithCredential:self->_newCredential
167-
completion:^(FIRAuthDataResult *_Nullable authResult,
168-
NSError *_Nullable error) {
166+
[authResult.user linkWithCredential:self->_newCredential
167+
completion:^(FIRAuthDataResult *_Nullable authResult,
168+
NSError *_Nullable error) {
169169
[self decrementActivity];
170170

171171
// Ignore any error (shouldn't happen) and treat the user as successfully signed in.

FacebookAuth/FirebaseFacebookAuthUI/FUIFacebookAuth.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ - (void)signInWithDefaultValue:(nullable NSString *)defaultValue
136136
_pendingSignInCallback = completion;
137137
_presentingViewController = presentingViewController;
138138

139-
[_loginManager logInWithReadPermissions:_scopes
140-
fromViewController:presentingViewController
141-
handler:^(FBSDKLoginManagerLoginResult *result,
142-
NSError *error) {
139+
[_loginManager logInWithPermissions:_scopes
140+
fromViewController:presentingViewController
141+
handler:^(FBSDKLoginManagerLoginResult *result,
142+
NSError *error) {
143143
if (error) {
144144
NSError *newError =
145145
[FUIAuthErrorUtils providerErrorWithUnderlyingError:error

PhoneAuth/FirebasePhoneAuthUI/CountryCode/FUIPhoneNumber.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
@class FUICountryCodeInfo;
2020
@class FUICountryCodes;
2121

22+
NS_ASSUME_NONNULL_BEGIN
23+
2224
FOUNDATION_EXPORT NSString * const FUIPhoneNumberValidationErrorDomain;
2325

2426
typedef NS_ENUM(NSInteger, FUIPhoneNumberValidationError) {
@@ -27,8 +29,6 @@ typedef NS_ENUM(NSInteger, FUIPhoneNumberValidationError) {
2729
FUIPhoneNumberValidationErrorMissingNumber = 2,
2830
};
2931

30-
NS_ASSUME_NONNULL_BEGIN
31-
3232
/** Encapsulates a phone number with the raw and the normalized representations */
3333
@interface FUIPhoneNumber : NSObject
3434

PhoneAuth/FirebasePhoneAuthUI/FUIPhoneVerificationViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ - (void)viewWillAppear:(BOOL)animated {
111111
}
112112

113113
- (void)viewWillDisappear:(BOOL)animated {
114+
[super viewWillDisappear:animated];
114115
[self unregisterFromNotifications];
115116
}
116117

samples/objc/FirebaseUI-demo-objc/FUIAppDelegate.m

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ - (BOOL)application:(UIApplication *)app
3636
return [self handleOpenUrl:url sourceApplication:sourceApplication];
3737
}
3838

39-
- (BOOL)application:(UIApplication *)application
40-
openURL:(NSURL *)url
41-
sourceApplication:(nullable NSString *)sourceApplication
42-
annotation:(id)annotation {
43-
return [self handleOpenUrl:url sourceApplication:sourceApplication];
44-
}
45-
4639
- (BOOL)application:(UIApplication *)application
4740
continueUserActivity:(nonnull NSUserActivity *)userActivity
4841
restorationHandler:

samples/objc/FirebaseUI-demo-objc/FUISample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#import <Foundation/Foundation.h>
2020
#import <UIKit/UIKit.h>
2121

22-
typedef UIViewController *(^FIRControllerBlock)();
22+
typedef UIViewController *(^FIRControllerBlock)(void);
2323

2424
@interface FUISample : NSObject
2525

samples/objc/FirebaseUI-demo-objc/Images.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@
103103
"scale" : "2x"
104104
},
105105
{
106-
"idiom" : "ios-marketing",
107106
"size" : "1024x1024",
107+
"idiom" : "ios-marketing",
108+
"filename" : "Webp.net-resizeimage.png",
108109
"scale" : "1x"
109110
}
110111
],

samples/objc/FirebaseUI-demo-objc/Samples/Auth/FUIAuthViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ - (void)authUI:(FUIAuth *)authUI
286286
if (error.code == FUIAuthErrorCodeMergeConflict) {
287287
FIRAuthCredential *credential = error.userInfo[FUIAuthCredentialKey];
288288
[[FUIAuth defaultAuthUI].auth
289-
signInAndRetrieveDataWithCredential:credential
290-
completion:^(FIRAuthDataResult *_Nullable authResult,
291-
NSError *_Nullable error) {
289+
signInWithCredential:credential
290+
completion:^(FIRAuthDataResult *_Nullable authResult,
291+
NSError *_Nullable error) {
292292
if (error) {
293293
[self showAlertWithTitlte:@"Sign-In error" message:error.description];
294294
NSLog(@"%@",error.description);

0 commit comments

Comments
 (0)