Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 389d43b

Browse files
committed
Merge pull request #38 from ParsePlatform/nlutsenko.v4.generics
Remove all usages of PF_GENERIC macro.
2 parents d4e53b7 + 8f43da7 commit 389d43b

9 files changed

+55
-55
lines changed

ParseFacebookUtils/Internal/AuthenticationProvider/PFFacebookAuthenticationProvider.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ extern NSString *const PFFacebookUserAuthenticationType;
3737
/// @name Authenticate
3838
///--------------------------------------
3939

40-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
41-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions;
42-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
43-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions
44-
fromViewComtroller:(UIViewController *)viewController;
40+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
41+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions;
42+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
43+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
44+
fromViewComtroller:(UIViewController *)viewController;
4545

4646
@end
4747

ParseFacebookUtils/Internal/AuthenticationProvider/PFFacebookAuthenticationProvider.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ + (instancetype)providerWithApplication:(UIApplication *)application
4242
#pragma mark - Authenticate
4343
///--------------------------------------
4444

45-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
46-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions {
45+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
46+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions {
4747
return [self authenticateAsyncWithReadPermissions:readPermissions
4848
publishPermissions:publishPermissions
4949
fromViewComtroller:[PFFacebookPrivateUtilities applicationTopViewController]];
5050
}
5151

52-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
53-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions
54-
fromViewComtroller:(UIViewController *)viewController {
52+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
53+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
54+
fromViewComtroller:(UIViewController *)viewController {
5555
return [BFTask taskWithError:[NSError pffb_invalidFacebookSessionError]];
5656
}
5757

5858
///--------------------------------------
5959
#pragma mark - PFUserAuthenticationDelegate
6060
///--------------------------------------
6161

62-
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData {
62+
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSString *> *)authData {
6363
FBSDKAccessToken *token = [PFFacebookPrivateUtilities facebookAccessTokenFromUserAuthenticationData:authData];
6464
if (!token) {
6565
return !authData; // Only deauthenticate if authData was nil, otherwise - return failure (`NO`).

ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#import "PFFacebookAuthenticationProvider.h"
1818

19-
@class BFTask PF_GENERIC(__covariant BFGenericType);
19+
@class BFTask<__covariant BFGenericType>;
2020

2121
NS_ASSUME_NONNULL_BEGIN
2222

ParseFacebookUtils/Internal/AuthenticationProvider/iOS/PFFacebookMobileAuthenticationProvider.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ - (instancetype)initWithApplication:(UIApplication *)application
4242
#pragma mark - Authenticate
4343
///--------------------------------------
4444

45-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *) *)readPermissions
46-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *) *)publishPermissions
47-
fromViewComtroller:(UIViewController *)viewController {
45+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
46+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
47+
fromViewComtroller:(UIViewController *)viewController {
4848
if (readPermissions && publishPermissions) {
4949
NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException
5050
reason:@"Read permissions are not permitted to be requested with publish permissions."
@@ -78,7 +78,7 @@ - (instancetype)initWithApplication:(UIApplication *)application
7878
#pragma mark - PFUserAuthenticationDelegate
7979
///--------------------------------------
8080

81-
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *) *)authData {
81+
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSString *> *)authData {
8282
if (!authData) {
8383
[self.loginManager logOut];
8484
}

ParseFacebookUtils/Internal/AuthenticationProvider/tvOS/PFFacebookDeviceAuthenticationProvider.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ @implementation PFFacebookDeviceAuthenticationProvider
3232
#pragma mark - PFFacebookAuthenticationProvider
3333
///--------------------------------------
3434

35-
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
36-
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions
37-
fromViewComtroller:(UIViewController *)viewController {
35+
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
36+
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
37+
fromViewComtroller:(UIViewController *)viewController {
3838
return [BFTask taskFromExecutor:[BFExecutor mainThreadExecutor] withBlock:^id _Nonnull{
3939
if (_loginTaskCompletionSource) {
4040
return [NSError errorWithDomain:FBSDKErrorDomain
@@ -57,7 +57,7 @@ @implementation PFFacebookDeviceAuthenticationProvider
5757
#pragma mark - PFUserAuthenticationDelegate
5858
///--------------------------------------
5959

60-
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData {
60+
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSString *> *)authData {
6161
if (!authData) {
6262
[FBSDKAccessToken setCurrentAccessToken:nil];
6363
}
@@ -76,7 +76,7 @@ - (void)deviceLoginViewControllerDidCancel:(FBSDKDeviceLoginViewController *)vie
7676

7777
- (void)deviceLoginViewControllerDidFinish:(FBSDKDeviceLoginViewController *)viewController {
7878
FBSDKAccessToken *accessToken = [FBSDKAccessToken currentAccessToken];
79-
NSDictionary PF_GENERIC(NSString *,NSString*) *result = [PFFacebookPrivateUtilities userAuthenticationDataFromAccessToken:accessToken];
79+
NSDictionary<NSString *,NSString*> *result = [PFFacebookPrivateUtilities userAuthenticationDataFromAccessToken:accessToken];
8080
[_loginTaskCompletionSource trySetResult:result];
8181
_loginViewController = nil;
8282
_loginTaskCompletionSource = nil;

ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ NS_ASSUME_NONNULL_BEGIN
2828
///--------------------------------------
2929

3030
+ (NSDictionary *)userAuthenticationDataWithFacebookUserId:(NSString *)userId
31-
accessToken:(NSString *)accessToken
32-
expirationDate:(NSDate *)expirationDate;
31+
accessToken:(NSString *)accessToken
32+
expirationDate:(NSDate *)expirationDate;
3333
+ (NSDictionary *)userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)token;
3434

35-
+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary PF_GENERIC(NSString *,NSString *) *)authData;
35+
+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary<NSString *, NSString *> *)authData;
3636

3737
@end
3838

ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ + (NSDictionary *)userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)toke
4343
expirationDate:token.expirationDate];
4444
}
4545

46-
+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary PF_GENERIC(NSString *,NSString *) *)authData {
46+
+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary<NSString *, NSString *> *)authData {
4747
NSString *accessToken = authData[@"access_token"];
4848
NSString *expirationDateString = authData[@"expiration_date"];
4949
if (!accessToken || !expirationDateString) {

ParseFacebookUtils/PFFacebookUtils.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
7171
7272
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
7373
*/
74-
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
74+
+ (BFTask<PFUser *> *)logInInBackgroundWithReadPermissions:(nullable NSArray<NSString *> *)permissions;
7575

7676
/**
7777
*Asynchronously* logs in a user using Facebook with read permissions.
@@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
8383
@param block The block to execute when the log in completes.
8484
It should have the following signature: `^(PFUser *user, NSError *error)`.
8585
*/
86-
+ (void)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
86+
+ (void)logInInBackgroundWithReadPermissions:(nullable NSArray<NSString *> *)permissions
8787
block:(nullable PFUserResultBlock)block;
8888

8989
/**
@@ -96,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN
9696
9797
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
9898
*/
99-
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
99+
+ (BFTask<PFUser *> *)logInInBackgroundWithPublishPermissions:(nullable NSArray<NSString *> *)permissions;
100100

101101
/**
102102
*Asynchronously* logs in a user using Facebook with publish permissions.
@@ -108,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN
108108
@param block The block to execute when the log in completes.
109109
It should have the following signature: `^(PFUser *user, NSError *error)`.
110110
*/
111-
+ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
111+
+ (void)logInInBackgroundWithPublishPermissions:(nullable NSArray<NSString *> *)permissions
112112
block:(nullable PFUserResultBlock)block;
113113

114114
/**
@@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN
121121
122122
@return The task that has will a have `result` set to `PFUser` if operation succeeds.
123123
*/
124-
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;
124+
+ (BFTask<PFUser *> *)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;
125125

126126
/**
127127
*Asynchronously* logs in a user using given Facebook Acess Token.
@@ -152,8 +152,8 @@ NS_ASSUME_NONNULL_BEGIN
152152
153153
@return The task that will have a `result` set to `@YES` if operation succeeds.
154154
*/
155-
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
156-
withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
155+
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
156+
withReadPermissions:(nullable NSArray<NSString *> *)permissions;
157157

158158
/**
159159
*Asynchronously* links Facebook with read permissions to an existing `PFUser`.
@@ -168,7 +168,7 @@ NS_ASSUME_NONNULL_BEGIN
168168
It should have the following signature: `^(BOOL succeeded, NSError *error)`.
169169
*/
170170
+ (void)linkUserInBackground:(PFUser *)user
171-
withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions
171+
withReadPermissions:(nullable NSArray<NSString *> *)permissions
172172
block:(nullable PFBooleanResultBlock)block;
173173

174174
/**
@@ -183,8 +183,8 @@ NS_ASSUME_NONNULL_BEGIN
183183
184184
@return The task that will have a `result` set to `@YES` if operation succeeds.
185185
*/
186-
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
187-
withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions;
186+
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
187+
withPublishPermissions:(NSArray<NSString *> *)permissions;
188188

189189
/**
190190
*Asynchronously* links Facebook with publish permissions to an existing `PFUser`.
@@ -199,7 +199,7 @@ NS_ASSUME_NONNULL_BEGIN
199199
It should have the following signature: `^(BOOL succeeded, NSError *error)`.
200200
*/
201201
+ (void)linkUserInBackground:(PFUser *)user
202-
withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions
202+
withPublishPermissions:(NSArray<NSString *> *)permissions
203203
block:(nullable PFBooleanResultBlock)block;
204204

205205
/**
@@ -214,7 +214,7 @@ NS_ASSUME_NONNULL_BEGIN
214214
215215
@return The task that will have a `result` set to `@YES` if operation succeeds.
216216
*/
217-
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;
217+
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;
218218

219219
/**
220220
*Asynchronously* links Facebook Access Token to an existing `PFUser`.
@@ -242,7 +242,7 @@ NS_ASSUME_NONNULL_BEGIN
242242
@param user User to unlink from Facebook.
243243
@return The task, that encapsulates the work being done.
244244
*/
245-
+ (BFTask PF_GENERIC(NSNumber *)*)unlinkUserInBackground:(PFUser *)user;
245+
+ (BFTask<NSNumber *> *)unlinkUserInBackground:(PFUser *)user;
246246

247247
/**
248248
Unlinks the `PFUser` from a Facebook account *asynchronously*.

0 commit comments

Comments
 (0)