Skip to content

Commit

Permalink
Merge pull request #327 from ParsePlatform/nlutsenko.watch.installation
Browse files Browse the repository at this point in the history
Exclude PFInstallation from watchOS target.
  • Loading branch information
nlutsenko committed Sep 26, 2015
2 parents 9e866f0 + bf64869 commit 4a4bc54
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 34 deletions.
24 changes: 0 additions & 24 deletions Parse.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface PFInstallationController : NSObject <PFObjectControlling>
PF_WATCH_UNAVAILABLE @interface PFInstallationController : NSObject <PFObjectControlling>

@property (nonatomic, weak, readonly) id<PFObjectControllerProvider, PFCurrentInstallationControllerProvider> dataSource;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern NSString *const PFCurrentInstallationPinName;
@class BFTask PF_GENERIC(__covariant BFGenericType);
@class PFInstallation;

@interface PFCurrentInstallationController : NSObject <PFCurrentObjectControlling>
PF_WATCH_UNAVAILABLE @interface PFCurrentInstallationController : NSObject <PFCurrentObjectControlling>

@property (nonatomic, weak, readonly) id<PFFileManagerProvider, PFInstallationIdentifierStoreProvider> commonDataSource;
@property (nonatomic, weak, readonly) id<PFObjectFilePersistenceControllerProvider> coreDataSource;
Expand Down
8 changes: 8 additions & 0 deletions Parse/Internal/PFCoreManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ - (void)setSessionController:(PFSessionController *)sessionController {
});
}

#if !TARGET_OS_WATCH

///--------------------------------------
#pragma mark - Current Installation Controller
///--------------------------------------
Expand Down Expand Up @@ -366,6 +368,8 @@ - (void)setCurrentInstallationController:(PFCurrentInstallationController *)cont
});
}

#endif

///--------------------------------------
#pragma mark - Current User Controller
///--------------------------------------
Expand Down Expand Up @@ -393,6 +397,8 @@ - (void)setCurrentUserController:(PFCurrentUserController *)currentUserControlle
});
}

#if !TARGET_OS_WATCH

///--------------------------------------
#pragma mark - Installation Controller
///--------------------------------------
Expand All @@ -414,6 +420,8 @@ - (void)setInstallationController:(PFInstallationController *)installationContro
});
}

#endif

///--------------------------------------
#pragma mark - User Controller
///--------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion Parse/Internal/ParseManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ - (void)unloadCoreManager {
});
}

#if !TARGET_OS_WATCH

#pragma mark PushManager

- (PFPushManager *)pushManager {
Expand All @@ -312,6 +314,8 @@ - (void)setPushManager:(PFPushManager *)pushManager {
});
}

#endif

#pragma mark AnalyticsController

- (PFAnalyticsController *)analyticsController {
Expand Down Expand Up @@ -368,8 +372,10 @@ - (BFTask *)preloadDiskObjectsToMemoryAsync {
@strongify(self);
[PFUser currentUser];
[PFConfig currentConfig];
#if !TARGET_OS_WATCH
[PFInstallation currentInstallation];

#endif

[self eventuallyQueue];

return nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface PFPushChannelsController : NSObject
PF_WATCH_UNAVAILABLE @interface PFPushChannelsController : NSObject

@property (nonatomic, weak, readonly) id<PFCurrentInstallationControllerProvider> dataSource;

Expand Down
4 changes: 3 additions & 1 deletion Parse/Internal/Push/Manager/PFPushManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#import <Foundation/Foundation.h>

#import <Parse/PFConstants.h>

#import "PFCoreDataProvider.h"
#import "PFDataProvider.h"

Expand All @@ -17,7 +19,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface PFPushManager : NSObject
PF_WATCH_UNAVAILABLE @interface PFPushManager : NSObject

@property (nonatomic, weak, readonly) id<PFCommandRunnerProvider> commonDataSource;
@property (nonatomic, weak, readonly) id<PFCurrentInstallationControllerProvider> coreDataSource;
Expand Down
2 changes: 1 addition & 1 deletion Parse/PFInstallation.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PF_ASSUME_NONNULL_BEGIN
the Parse cloud can be used to target push notifications.
*/

@interface PFInstallation : PFObject<PFSubclassing>
PF_WATCH_UNAVAILABLE @interface PFInstallation : PFObject<PFSubclassing>

///--------------------------------------
/// @name Accessing the Current Installation
Expand Down
3 changes: 1 addition & 2 deletions Parse/PFQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,7 @@ typedef void (^PFQueryArrayResultBlock)(NSArray PF_GENERIC(PFGenericObject) * PF
@param error Pointer to an NSError that will be set if necessary.
@result The PFUser if found. Returns nil if the object isn't found, or if there was an error.
*/
+ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId
error:(NSError **)error;
+ (PF_NULLABLE PFUser *)getUserObjectWithId:(NSString *)objectId error:(NSError **)error;

/*!
@deprecated Please use [PFUser query] instead.
Expand Down
6 changes: 4 additions & 2 deletions Parse/Parse.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ + (void)setApplicationId:(NSString *)applicationId clientKey:(NSString *)clientK
// We're forced to register subclasses directly this way, in order to prevent a deadlock.
// If we ever switch to bundle scanning, this code can go away.
[subclassingController registerSubclass:[PFUser class]];
[subclassingController registerSubclass:[PFInstallation class]];
[subclassingController registerSubclass:[PFSession class]];
[subclassingController registerSubclass:[PFRole class]];
[subclassingController registerSubclass:[PFPin class]];
[subclassingController registerSubclass:[PFEventuallyPin class]];
#if TARGET_OS_IPHONE
#if !TARGET_OS_WATCH
[subclassingController registerSubclass:[PFInstallation class]];
#if TARGET_OS_IOS
[subclassingController registerSubclass:[PFProduct class]];
#endif
#endif

[currentParseManager_ preloadDiskObjectsToMemoryAsync];
Expand Down

0 comments on commit 4a4bc54

Please sign in to comment.