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

Remove all usages of PF_GENERIC macro. #38

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ extern NSString *const PFFacebookUserAuthenticationType;
/// @name Authenticate
///--------------------------------------

- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions;
- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions
fromViewComtroller:(UIViewController *)viewController;
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions;
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions
fromViewComtroller:(UIViewController *)viewController;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ + (instancetype)providerWithApplication:(UIApplication *)application
#pragma mark - Authenticate
///--------------------------------------

- (BFTask PF_GENERIC(NSDictionary<NSString *, NSString *>*)*)authenticateAsyncWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)readPermissions
publishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)publishPermissions {
- (BFTask<NSDictionary<NSString *, NSString *>*> *)authenticateAsyncWithReadPermissions:(nullable NSArray<NSString *> *)readPermissions
publishPermissions:(nullable NSArray<NSString *> *)publishPermissions {
return [self authenticateAsyncWithReadPermissions:readPermissions
publishPermissions:publishPermissions
fromViewComtroller:[PFFacebookPrivateUtilities applicationTopViewController]];
}

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

///--------------------------------------
#pragma mark - PFUserAuthenticationDelegate
///--------------------------------------

- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *)*)authData {
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSString *> *)authData {
FBSDKAccessToken *token = [PFFacebookPrivateUtilities facebookAccessTokenFromUserAuthenticationData:authData];
if (!token) {
return !authData; // Only deauthenticate if authData was nil, otherwise - return failure (`NO`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "PFFacebookAuthenticationProvider.h"

@class BFTask PF_GENERIC(__covariant BFGenericType);
@class BFTask<__covariant BFGenericType>;

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ - (instancetype)initWithApplication:(UIApplication *)application
#pragma mark - Authenticate
///--------------------------------------

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

- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary PF_GENERIC(NSString *, NSString *) *)authData {
- (BOOL)restoreAuthenticationWithAuthData:(nullable NSDictionary<NSString *, NSString *> *)authData {
if (!authData) {
[self.loginManager logOut];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ @implementation PFFacebookDeviceAuthenticationProvider
#pragma mark - PFFacebookAuthenticationProvider
///--------------------------------------

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

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

- (void)deviceLoginViewControllerDidFinish:(FBSDKDeviceLoginViewController *)viewController {
FBSDKAccessToken *accessToken = [FBSDKAccessToken currentAccessToken];
NSDictionary PF_GENERIC(NSString *,NSString*) *result = [PFFacebookPrivateUtilities userAuthenticationDataFromAccessToken:accessToken];
NSDictionary<NSString *,NSString*> *result = [PFFacebookPrivateUtilities userAuthenticationDataFromAccessToken:accessToken];
[_loginTaskCompletionSource trySetResult:result];
_loginViewController = nil;
_loginTaskCompletionSource = nil;
Expand Down
6 changes: 3 additions & 3 deletions ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ NS_ASSUME_NONNULL_BEGIN
///--------------------------------------

+ (NSDictionary *)userAuthenticationDataWithFacebookUserId:(NSString *)userId
accessToken:(NSString *)accessToken
expirationDate:(NSDate *)expirationDate;
accessToken:(NSString *)accessToken
expirationDate:(NSDate *)expirationDate;
+ (NSDictionary *)userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)token;

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

@end

Expand Down
2 changes: 1 addition & 1 deletion ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ + (NSDictionary *)userAuthenticationDataFromAccessToken:(FBSDKAccessToken *)toke
expirationDate:token.expirationDate];
}

+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary PF_GENERIC(NSString *,NSString *) *)authData {
+ (FBSDKAccessToken *)facebookAccessTokenFromUserAuthenticationData:(nullable NSDictionary<NSString *, NSString *> *)authData {
NSString *accessToken = authData[@"access_token"];
NSString *expirationDateString = authData[@"expiration_date"];
if (!accessToken || !expirationDateString) {
Expand Down
26 changes: 13 additions & 13 deletions ParseFacebookUtils/PFFacebookUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
+ (BFTask<PFUser *> *)logInInBackgroundWithReadPermissions:(nullable NSArray<NSString *> *)permissions;

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

/**
Expand All @@ -96,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithPublishPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
+ (BFTask<PFUser *> *)logInInBackgroundWithPublishPermissions:(nullable NSArray<NSString *> *)permissions;

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

/**
Expand All @@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that has will a have `result` set to `PFUser` if operation succeeds.
*/
+ (BFTask PF_GENERIC(PFUser *)*)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;
+ (BFTask<PFUser *> *)logInInBackgroundWithAccessToken:(FBSDKAccessToken *)accessToken;

/**
*Asynchronously* logs in a user using given Facebook Acess Token.
Expand Down Expand Up @@ -152,8 +152,8 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
withReadPermissions:(nullable NSArray PF_GENERIC(NSString *)*)permissions;
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
withReadPermissions:(nullable NSArray<NSString *> *)permissions;

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

/**
Expand All @@ -183,8 +183,8 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user
withPublishPermissions:(NSArray PF_GENERIC(NSString *)*)permissions;
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user
withPublishPermissions:(NSArray<NSString *> *)permissions;

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

/**
Expand All @@ -214,7 +214,7 @@ NS_ASSUME_NONNULL_BEGIN

@return The task that will have a `result` set to `@YES` if operation succeeds.
*/
+ (BFTask PF_GENERIC(NSNumber *)*)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;
+ (BFTask<NSNumber *> *)linkUserInBackground:(PFUser *)user withAccessToken:(FBSDKAccessToken *)accessToken;

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

/**
Unlinks the `PFUser` from a Facebook account *asynchronously*.
Expand Down
Loading