Skip to content
Closed
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
10 changes: 1 addition & 9 deletions Parse.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ Pod::Spec.new do |s|
'Parse/Internal/Purchase/**/*.{h,m}',
'Parse/Internal/PFMemoryEventuallyQueue.{h,m}'
s.tvos.exclude_files = 'Parse/PFNetworkActivityIndicatorManager.{h,m}',
'Parse/PFPush.{h,m}',
'Parse/PFInstallation.{h,m}',
'Parse/Internal/PFAlertView.{h,m}',
'Parse/Internal/Push/**/*.{h,m}',
'Parse/Internal/Installation/Controller/*.{h,m}',
'Parse/Internal/Installation/Constants/*.{h,m}',
'Parse/Internal/Installation/CurrentInstallationController/*.{h,m}',
'Parse/Internal/Installation/PFInstallationPrivate.h',
'Parse/Internal/Commands/PFRESTPushCommand.{h,m}'
'Parse/Internal/PFAlertView.{h,m}'
s.watchos.exclude_files = 'Parse/PFNetworkActivityIndicatorManager.{h,m}',
'Parse/PFProduct.{h,m}',
'Parse/PFPurchase.{h,m}',
Expand Down
54 changes: 50 additions & 4 deletions Parse.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Parse/Internal/Commands/PFRESTPushCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@

#import <Parse/PFConstants.h>

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class PFPushState;

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFRESTPushCommand : PFRESTCommand
PF_WATCH_UNAVAILABLE @interface PFRESTPushCommand : PFRESTCommand

+ (instancetype)sendPushCommandWithPushState:(PFPushState *)state
sessionToken:(nullable NSString *)sessionToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
#import "PFCoreDataProvider.h"
#import "PFObjectControlling.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @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 @@ -16,7 +16,6 @@
#import "PFDataProvider.h"
#import "PFMacros.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

extern NSString *const PFCurrentInstallationFileName;
Expand All @@ -25,7 +24,7 @@ extern NSString *const PFCurrentInstallationPinName;
@class BFTask PF_GENERIC(__covariant BFGenericType);
@class PFInstallation;

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

@property (nonatomic, weak, readonly) id<PFInstallationIdentifierStoreProvider> commonDataSource;
@property (nonatomic, weak, readonly) id<PFObjectFilePersistenceControllerProvider> coreDataSource;
Expand Down
1 change: 0 additions & 1 deletion Parse/Internal/Installation/PFInstallationPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#import <Parse/PFInstallation.h>

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@interface PFInstallation (Private)
Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/PFCoreManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PFObjectFilePersistenceControllerProvider,
PFPinningObjectStoreProvider,
PFObjectLocalIdStoreProvider,
PFUserAuthenticationControllerProvider,
#if !TARGET_OS_TV && !TARGET_OS_WATCH
#if !TARGET_OS_WATCH
PFInstallationControllerProvider,
PFCurrentInstallationControllerProvider,
#endif
Expand Down
8 changes: 4 additions & 4 deletions Parse/Internal/PFCoreManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#import "PFUserAuthenticationController.h"
#import "PFUserController.h"

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
#import "PFCurrentInstallationController.h"
#import "PFInstallationController.h"
#endif
Expand Down Expand Up @@ -62,7 +62,7 @@ @implementation PFCoreManager
@synthesize currentUserController = _currentUserController;
@synthesize userController = _userController;

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
@synthesize currentInstallationController = _currentInstallationController;
@synthesize installationController = _installationController;
#endif
Expand Down Expand Up @@ -361,7 +361,7 @@ - (void)setSessionController:(PFSessionController *)sessionController {
});
}

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH

///--------------------------------------
#pragma mark - Current Installation Controller
Expand Down Expand Up @@ -419,7 +419,7 @@ - (void)setCurrentUserController:(PFCurrentUserController *)currentUserControlle
});
}

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH

///--------------------------------------
#pragma mark - Installation Controller
Expand Down
2 changes: 1 addition & 1 deletion Parse/Internal/ParseManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PFInstallationIdentifierStoreProvider>

@property (nonatomic, strong, readonly) PFCoreManager *coreManager;

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
@property (nonatomic, strong) PFPushManager *pushManager;
#endif

Expand Down
8 changes: 4 additions & 4 deletions Parse/Internal/ParseManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#import "PFURLSessionCommandRunner.h"
#import "PFPersistenceController.h"

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
#import "PFPushManager.h"
#import "PFInstallation.h"
#endif
Expand Down Expand Up @@ -75,7 +75,7 @@ @implementation ParseManager
@synthesize keyValueCache = _keyValueCache;
@synthesize coreManager = _coreManager;
@synthesize analyticsController = _analyticsController;
#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
@synthesize pushManager = _pushManager;
#endif
#if TARGET_OS_IOS
Expand Down Expand Up @@ -360,7 +360,7 @@ - (void)unloadCoreManager {
});
}

#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH

#pragma mark PushManager

Expand Down Expand Up @@ -437,7 +437,7 @@ - (BFTask *)preloadDiskObjectsToMemoryAsync {
@strongify(self);
[PFUser currentUser];
[PFConfig currentConfig];
#if !TARGET_OS_WATCH && !TARGET_OS_TV
#if !TARGET_OS_WATCH
[PFInstallation currentInstallation];
#endif

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

#import "PFCoreDataProvider.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class BFTask PF_GENERIC(__covariant BFGenericType);

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPushChannelsController : NSObject
PF_WATCH_UNAVAILABLE @interface PFPushChannelsController : NSObject

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

Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/Push/Controller/PFPushController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#import <Parse/PFConstants.h>

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class BFTask PF_GENERIC(__covariant BFGenericType);
Expand All @@ -20,7 +19,7 @@ PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPushController : NSObject
PF_WATCH_UNAVAILABLE @interface PFPushController : NSObject

@property (nonatomic, strong, readonly) id<PFCommandRunning> commandRunner;

Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/Push/Manager/PFPushManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
#import "PFCoreDataProvider.h"
#import "PFDataProvider.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class PFPushChannelsController;
@class PFPushController;

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @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
1 change: 0 additions & 1 deletion Parse/Internal/Push/PFPushPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#import "PFMacros.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN
Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/Push/State/PFMutablePushState.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

#import "PFPushState.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFMutablePushState : PFPushState
PF_WATCH_UNAVAILABLE @interface PFMutablePushState : PFPushState

@property (nullable, nonatomic, copy, readwrite) NSSet *channels;
@property (nullable, nonatomic, copy, readwrite) PFQueryState *queryState;
Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/Push/State/PFPushState.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@

#import "PFBaseState.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class PFQueryState;

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPushState : PFBaseState <NSCopying, NSMutableCopying>
PF_WATCH_UNAVAILABLE @interface PFPushState : PFBaseState <NSCopying, NSMutableCopying>

@property (nullable, nonatomic, copy, readonly) NSSet *channels;
@property (nullable, nonatomic, copy, readonly) PFQueryState *queryState;
Expand Down
3 changes: 1 addition & 2 deletions Parse/Internal/Push/Utilites/PFPushUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

#import "PFPushPrivate.h"

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN

PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPushUtilities : NSObject <PFPushInternalUtils>
PF_WATCH_UNAVAILABLE @interface PFPushUtilities : NSObject <PFPushInternalUtils>

@end

Expand Down
8 changes: 6 additions & 2 deletions Parse/PFConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@

NSInteger const PARSE_API_VERSION = 2;

#if PARSE_IOS_ONLY
#if TARGET_OS_IOS
NSString *const kPFDeviceType = @"ios";
#else
#elif PF_TARGET_OS_OSX
NSString *const kPFDeviceType = @"osx";
#elif TARGET_OS_TV
NSString *const kPFDeviceType = @"appletv";
#elif TARGET_OS_WATCH
NSString *const kPFDeviceType = @"applewatch";
#endif

NSString *const kPFParseServer = @"https://api.parse.com";
Expand Down
5 changes: 2 additions & 3 deletions Parse/PFInstallation.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import <Parse/PFObject.h>
#import <Parse/PFSubclassing.h>

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -35,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
the Parse cloud can be used to target push notifications.
*/

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

///--------------------------------------
/// @name Accessing the Current Installation
Expand Down Expand Up @@ -74,7 +73,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFInstallation : PFObject<PFSu
/**
The badge for the `PFInstallation`.
*/
@property (nonatomic, assign) NSInteger badge;
@property (nonatomic, assign) NSInteger badge PF_TV_UNAVAILABLE;

/**
The name of the time zone for the `PFInstallation`.
Expand Down
6 changes: 5 additions & 1 deletion Parse/PFInstallation.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ + (instancetype)currentInstallation {
///--------------------------------------

- (id)objectForKey:(NSString *)key {
#if !TARGET_OS_TV
if ([key isEqualToString:PFInstallationKeyBadge] && [self _isCurrentInstallation]) {
// Update the data dictionary badge value from the device.
[self _updateBadgeFromDevice];
}
#endif

return [super objectForKey:key];
}
Expand Down Expand Up @@ -250,7 +252,9 @@ - (void)_objectWillSave {
if ([self _isCurrentInstallation]) {
@synchronized(self.lock) {
[self _updateTimeZoneFromDevice];
#if !TARGET_OS_TV
[self _updateBadgeFromDevice];
#endif
[self _updateVersionInfoFromDevice];
[self _updateLocaleIdentifierFromDevice];
}
Expand All @@ -266,7 +270,7 @@ - (void)_updateTimeZoneFromDevice {
}
}

- (void)_updateBadgeFromDevice {
- (void)_updateBadgeFromDevice PF_TV_UNAVAILABLE {
// Get the application icon and update the installation if necessary.
NSNumber *applicationBadge = @([PFApplication currentApplication].iconBadgeNumber);
NSNumber *installationBadge = [super objectForKey:PFInstallationKeyBadge];
Expand Down
5 changes: 2 additions & 3 deletions Parse/PFPush.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#import <Parse/PFConstants.h>
#import <Parse/PFInstallation.h>

PF_TV_UNAVAILABLE_WARNING
PF_WATCH_UNAVAILABLE_WARNING

@class PFQuery PF_GENERIC(PFGenericObject : PFObject *);
Expand All @@ -27,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
The preferred way of modifying or retrieving channel subscriptions is to use
the `PFInstallation` class, instead of the class methods in `PFPush`.
*/
PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject <NSCopying>
PF_WATCH_UNAVAILABLE @interface PFPush : NSObject <NSCopying>

///--------------------------------------
/// @name Creating a Push Notification
Expand Down Expand Up @@ -399,7 +398,7 @@ PF_TV_UNAVAILABLE PF_WATCH_UNAVAILABLE @interface PFPush : NSObject <NSCopying>

@param userInfo The userInfo dictionary you get in `appplication:didReceiveRemoteNotification:`.
*/
+ (void)handlePush:(nullable NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0) PF_EXTENSION_UNAVAILABLE("");
+ (void)handlePush:(nullable NSDictionary *)userInfo NS_AVAILABLE_IOS(3_0) PF_EXTENSION_UNAVAILABLE("") PF_TV_UNAVAILABLE;

///--------------------------------------
/// @name Managing Channel Subscriptions
Expand Down
2 changes: 1 addition & 1 deletion Parse/PFPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ + (void)unsubscribeFromChannelInBackground:(NSString *)channel target:(id)target
#pragma mark - Handling Notifications
///--------------------------------------

#if PARSE_IOS_ONLY
#if TARGET_OS_IOS
+ (void)handlePush:(NSDictionary *)userInfo {
UIApplication *application = [UIApplication sharedApplication];
if (application.applicationState != UIApplicationStateActive) {
Expand Down
2 changes: 2 additions & 0 deletions Parse/Parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

#elif TARGET_OS_TV

#import <Parse/PFInstallation.h>
#import <Parse/PFPush.h>
#import <Parse/PFProduct.h>
#import <Parse/PFPurchase.h>

Expand Down
Loading