diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-02-22 15:27:24 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-02-22 15:27:24 -0500 |
commit | dc15b45f58c65b6d5d961062c5374997f6747689 (patch) | |
tree | 6c14a95ca7bb61e725c09b08ec0c77d4eb9d19f7 | |
parent | 463357d2c16ce9141646f8c315f41dc0b2c08155 (diff) | |
download | sdl_ios-dc15b45f58c65b6d5d961062c5374997f6747689.tar.gz |
Implement SDL 0027
* Fixes #537
* Update button & command handlers to be specific
-rw-r--r-- | SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 12 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAddCommand.h | 15 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAddCommand.m | 8 | ||||
-rw-r--r-- | SmartDeviceLink/SDLNotificationConstants.h | 31 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRequestHandler.h | 33 | ||||
-rw-r--r-- | SmartDeviceLink/SDLResponseDispatcher.h | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLResponseDispatcher.m | 14 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSoftButton.h | 9 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSoftButton.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSubscribeButton.h | 17 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSubscribeButton.m | 4 | ||||
-rw-r--r-- | SmartDeviceLink/SmartDeviceLink.h | 1 |
12 files changed, 62 insertions, 92 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 566a56bcc..9a1924377 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -761,7 +761,6 @@ 5D61FE141A84238C00846EE7 /* SDLWiperStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */; }; 5D6CC8EF1C610E660027F60A /* SDLSecurityType.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6CC8EE1C610E660027F60A /* SDLSecurityType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D6EB4CC1BF28DC600693731 /* NSMapTable+SubscriptingSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D6EB4CB1BF28DC600693731 /* NSMapTable+SubscriptingSpec.m */; }; - 5D6F7A2B1BC45BF70070BF37 /* SDLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6F7A2A1BC45BF70070BF37 /* SDLRequestHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D6F7A2E1BC5650B0070BF37 /* SDLLifecycleConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6F7A2C1BC5650B0070BF37 /* SDLLifecycleConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5D6F7A2F1BC5650B0070BF37 /* SDLLifecycleConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D6F7A2D1BC5650B0070BF37 /* SDLLifecycleConfiguration.m */; }; 5D6F7A351BC5B9B60070BF37 /* SDLLockScreenViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D6F7A331BC5B9B60070BF37 /* SDLLockScreenViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1768,7 +1767,6 @@ 5D61FC271A84238C00846EE7 /* SDLWiperStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLWiperStatus.m; sourceTree = "<group>"; }; 5D6CC8EE1C610E660027F60A /* SDLSecurityType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLSecurityType.h; sourceTree = "<group>"; }; 5D6EB4CB1BF28DC600693731 /* NSMapTable+SubscriptingSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMapTable+SubscriptingSpec.m"; path = "DevAPISpecs/NSMapTable+SubscriptingSpec.m"; sourceTree = "<group>"; }; - 5D6F7A2A1BC45BF70070BF37 /* SDLRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLRequestHandler.h; sourceTree = "<group>"; }; 5D6F7A2C1BC5650B0070BF37 /* SDLLifecycleConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLLifecycleConfiguration.h; sourceTree = "<group>"; }; 5D6F7A2D1BC5650B0070BF37 /* SDLLifecycleConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLLifecycleConfiguration.m; sourceTree = "<group>"; }; 5D6F7A331BC5B9B60070BF37 /* SDLLockScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLLockScreenViewController.h; sourceTree = "<group>"; }; @@ -3419,7 +3417,6 @@ isa = PBXGroup; children = ( 5D6F7A301BC5B7100070BF37 /* Lock Screen UI */, - 5DA3F3611BC448690026F2D0 /* Handler Additions */, 5DA3F3561BC4480E0026F2D0 /* Utilities */, 5D8204171BCD80A200D0A41B /* Configurations */, 5DBAE0A61D355EF200CE00BF /* Managers */, @@ -3463,14 +3460,6 @@ name = Notifications; sourceTree = "<group>"; }; - 5DA3F3611BC448690026F2D0 /* Handler Additions */ = { - isa = PBXGroup; - children = ( - 5D6F7A2A1BC45BF70070BF37 /* SDLRequestHandler.h */, - ); - name = "Handler Additions"; - sourceTree = "<group>"; - }; 5DAE06711BDEC68700F9B498 /* Developer API Tests */ = { isa = PBXGroup; children = ( @@ -3981,7 +3970,6 @@ 5D61FE051A84238C00846EE7 /* SDLVehicleDataResultCode.h in Headers */, 5D61FD2B1A84238C00846EE7 /* SDLPerformInteractionResponse.h in Headers */, 5D61FDA11A84238C00846EE7 /* SDLSoftButtonCapabilities.h in Headers */, - 5D6F7A2B1BC45BF70070BF37 /* SDLRequestHandler.h in Headers */, 5D61FDB51A84238C00846EE7 /* SDLSyncMsgVersion.h in Headers */, 5DA102A41D4122C700C15826 /* NSMutableDictionary+SafeRemove.h in Headers */, 5D61FE031A84238C00846EE7 /* SDLVehicleDataResult.h in Headers */, diff --git a/SmartDeviceLink/SDLAddCommand.h b/SmartDeviceLink/SDLAddCommand.h index fb7ea7498..509ea80fa 100644 --- a/SmartDeviceLink/SDLAddCommand.h +++ b/SmartDeviceLink/SDLAddCommand.h @@ -5,10 +5,9 @@ #import "SDLImageType.h" #import "SDLNotificationConstants.h" -#import "SDLRequestHandler.h" -@class SDLMenuParams; @class SDLImage; +@class SDLMenuParams; /** * This class will add a command to the application's Command Menu SDLMenuParams @@ -37,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface SDLAddCommand : SDLRPCRequest <SDLRequestHandler> +@interface SDLAddCommand : SDLRPCRequest /** * Construct a SDLAddCommand with a handler callback when an event occurs. @@ -46,20 +45,20 @@ NS_ASSUME_NONNULL_BEGIN * * @return An SDLAddCommand object */ -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithHandler:(nullable SDLRPCCommandNotificationHandler)handler; -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCCommandNotificationHandler)handler; -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCCommandNotificationHandler)handler; -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(nullable SDLRPCCommandNotificationHandler)handler; /** * A handler that will let you know when the button you created is subscribed. * * @warning This will only work if you use SDLManager. */ -@property (nullable, copy, nonatomic) SDLRPCNotificationHandler handler; +@property (nullable, copy, nonatomic) SDLRPCCommandNotificationHandler handler; /** * @abstract A Unique Command ID that identifies the command diff --git a/SmartDeviceLink/SDLAddCommand.m b/SmartDeviceLink/SDLAddCommand.m index 8c491359b..bfec12164 100644 --- a/SmartDeviceLink/SDLAddCommand.m +++ b/SmartDeviceLink/SDLAddCommand.m @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithHandler:(nullable SDLRPCCommandNotificationHandler)handler { self = [self init]; if (!self) { return nil; @@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands handler:(nullable SDLRPCCommandNotificationHandler)handler { self = [self init]; if (!self) { return nil; @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName handler:(SDLRPCCommandNotificationHandler)handler { self = [self initWithId:commandId vrCommands:vrCommands handler:handler]; if (!self) { return nil; @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithId:(UInt32)commandId vrCommands:(nullable NSArray<NSString *> *)vrCommands menuName:(NSString *)menuName parentId:(UInt32)parentId position:(UInt16)position iconValue:(NSString *)iconValue iconType:(SDLImageType)iconType handler:(nullable SDLRPCCommandNotificationHandler)handler { self = [self initWithId:commandId vrCommands:vrCommands menuName:menuName handler:handler]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLNotificationConstants.h b/SmartDeviceLink/SDLNotificationConstants.h index 63fad1b25..e22d0c421 100644 --- a/SmartDeviceLink/SDLNotificationConstants.h +++ b/SmartDeviceLink/SDLNotificationConstants.h @@ -7,6 +7,10 @@ // #import <Foundation/Foundation.h> + +@class SDLOnButtonEvent; +@class SDLOnButtonPress; +@class SDLOnCommand; @class SDLRPCNotification; @class SDLRPCResponse; @class SDLRPCRequest; @@ -27,13 +31,6 @@ typedef NSString *SDLNotificationUserInfoKey; #pragma mark - Blocks /** - * A handler used on certain RPCs, primarily buttons or commands, when an event occurs. - * - * @param notification The RPC Notification that was fired. - */ -typedef void (^SDLRPCNotificationHandler)(__kindof SDLRPCNotification *notification); - -/** * A handler used on all RPC requests which fires when the response is received. * * @param request The request which was sent. @@ -42,6 +39,26 @@ typedef void (^SDLRPCNotificationHandler)(__kindof SDLRPCNotification *notificat */ typedef void (^SDLResponseHandler)(__kindof SDLRPCRequest *__nullable request, __kindof SDLRPCResponse *__nullable response, NSError *__nullable error); + +/** + A handler that may optionally be run when an SDLSubscribeButton or SDLSoftButton has a corresponding notification occur. + + @warning This only works if you send the RPC using SDLManager. + @warning Only one of the two parameters will be set for each block call. + + @param buttonPressNotification An SDLOnButtonPress object that corresponds to this particular button. + @param buttonEventNotification An SDLOnButtonEvent object that corresponds to this particular button. + */ +typedef void (^SDLRPCButtonNotificationHandler)(SDLOnButtonPress *_Nullable buttonPressNotification, SDLOnButtonEvent *_Nullable buttonEventNotification); +/** + A handler that may optionally be run when an SDLAddCommand has a corresponding notification occur. + + @warning This only works if you send the RPC using SDLManager. + + @param notification An SDLOnCommand object that corresponds to this particular SDLAddCommand. + */ +typedef void (^SDLRPCCommandNotificationHandler)(SDLOnCommand *notification); + /** * The key used in all SDL NSNotifications to extract the response or notification from the userinfo dictionary. */ diff --git a/SmartDeviceLink/SDLRequestHandler.h b/SmartDeviceLink/SDLRequestHandler.h deleted file mode 100644 index 64ee67b48..000000000 --- a/SmartDeviceLink/SDLRequestHandler.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// SDLRequestHandler.h -// SmartDeviceLink-iOS -// -// Created by Joel Fischer on 10/6/15. -// Copyright © 2015 smartdevicelink. All rights reserved. -// - -#import <Foundation/Foundation.h> - -#import "SDLNotificationConstants.h" - -NS_ASSUME_NONNULL_BEGIN - -@protocol SDLRequestHandler <NSObject> - -/** - * The handler that is added to any RPC implementing this protocol. - */ -@property (nullable, copy, nonatomic) SDLRPCNotificationHandler handler; - -/** - * A special init function on any RPC implementing this protocol. - * - * @param handler The handler to be called at specified times, such as events for buttons. - * - * @return An instance of the class implementing this protocol. - */ -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLResponseDispatcher.h b/SmartDeviceLink/SDLResponseDispatcher.h index f89c5cc59..3e31662e0 100644 --- a/SmartDeviceLink/SDLResponseDispatcher.h +++ b/SmartDeviceLink/SDLResponseDispatcher.h @@ -38,17 +38,17 @@ NS_ASSUME_NONNULL_BEGIN /** * Holds a map of command ids and their corresponding blocks. */ -@property (strong, nonatomic, readonly) NSMapTable<SDLAddCommandCommandId *, SDLRPCNotificationHandler> *commandHandlerMap; +@property (strong, nonatomic, readonly) NSMapTable<SDLAddCommandCommandId *, SDLRPCCommandNotificationHandler> *commandHandlerMap; /** * Holds a map of button names and their corresponding blocks. */ -@property (strong, nonatomic, readonly) NSMapTable<SDLSubscribeButtonName *, SDLRPCNotificationHandler> *buttonHandlerMap; +@property (strong, nonatomic, readonly) NSMapTable<SDLSubscribeButtonName *, SDLRPCButtonNotificationHandler> *buttonHandlerMap; /** * Holds a map of soft button ids and their corresponding blocks. */ -@property (strong, nonatomic, readonly) NSMapTable<SDLSoftButtonId *, SDLRPCNotificationHandler> *customButtonHandlerMap; +@property (strong, nonatomic, readonly) NSMapTable<SDLSoftButtonId *, SDLRPCButtonNotificationHandler> *customButtonHandlerMap; /** * Create a new response dispatcher. diff --git a/SmartDeviceLink/SDLResponseDispatcher.m b/SmartDeviceLink/SDLResponseDispatcher.m index f6e07ea1e..3c2928912 100644 --- a/SmartDeviceLink/SDLResponseDispatcher.m +++ b/SmartDeviceLink/SDLResponseDispatcher.m @@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)sdl_runHandlerForCommand:(NSNotification *)notification { SDLOnCommand *onCommandNotification = notification.userInfo[SDLNotificationUserInfoObject]; - SDLRPCNotificationHandler handler = nil; + SDLRPCCommandNotificationHandler handler = nil; handler = self.commandHandlerMap[onCommandNotification.cmdID]; if (handler) { @@ -188,14 +188,14 @@ NS_ASSUME_NONNULL_BEGIN - (void)sdl_runHandlerForButton:(NSNotification *)notification { __kindof SDLRPCNotification *rpcNotification = notification.userInfo[SDLNotificationUserInfoObject]; - SDLRPCNotificationHandler handler = nil; + SDLRPCButtonNotificationHandler handler = nil; SDLButtonName name = nil; NSNumber *customID = nil; - if ([rpcNotification isKindOfClass:[SDLOnButtonEvent class]]) { + if ([rpcNotification isMemberOfClass:[SDLOnButtonEvent class]]) { name = ((SDLOnButtonEvent *)rpcNotification).buttonName; customID = ((SDLOnButtonEvent *)rpcNotification).customButtonID; - } else if ([rpcNotification isKindOfClass:[SDLOnButtonPress class]]) { + } else if ([rpcNotification isMemberOfClass:[SDLOnButtonPress class]]) { name = ((SDLOnButtonPress *)rpcNotification).buttonName; customID = ((SDLOnButtonPress *)rpcNotification).customButtonID; } @@ -207,7 +207,11 @@ NS_ASSUME_NONNULL_BEGIN } if (handler) { - handler(rpcNotification); + if ([rpcNotification isMemberOfClass:[SDLOnButtonEvent class]]) { + handler(nil, rpcNotification); + } else if ([rpcNotification isMemberOfClass:[SDLOnButtonPress class]]) { + handler(rpcNotification, nil); + } } } diff --git a/SmartDeviceLink/SDLSoftButton.h b/SmartDeviceLink/SDLSoftButton.h index a5cc9d7a4..398bf8053 100644 --- a/SmartDeviceLink/SDLSoftButton.h +++ b/SmartDeviceLink/SDLSoftButton.h @@ -4,7 +4,6 @@ #import "SDLRPCMessage.h" #import "SDLNotificationConstants.h" -#import "SDLRequestHandler.h" #import "SDLSoftButtonType.h" #import "SDLSystemAction.h" @@ -12,13 +11,13 @@ NS_ASSUME_NONNULL_BEGIN -@interface SDLSoftButton : SDLRPCStruct <SDLRequestHandler> +@interface SDLSoftButton : SDLRPCStruct -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler; -- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCButtonNotificationHandler)handler; -@property (copy, nonatomic) SDLRPCNotificationHandler handler; +@property (copy, nonatomic) SDLRPCButtonNotificationHandler handler; @property (strong, nonatomic) SDLSoftButtonType type; @property (strong, nonatomic, nullable) NSString *text; diff --git a/SmartDeviceLink/SDLSoftButton.m b/SmartDeviceLink/SDLSoftButton.m index c33880c06..a50bb4bcd 100644 --- a/SmartDeviceLink/SDLSoftButton.m +++ b/SmartDeviceLink/SDLSoftButton.m @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLSoftButton -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self init]; if (!self) { return nil; @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithType:(SDLSoftButtonType)type text:(nullable NSString *)text image:(nullable SDLImage *)image highlighted:(BOOL)highlighted buttonId:(UInt16)buttonId systemAction:(nullable SDLSystemAction)systemAction handler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self initWithHandler:handler]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLSubscribeButton.h b/SmartDeviceLink/SDLSubscribeButton.h index 6b3465636..11f25a8ea 100644 --- a/SmartDeviceLink/SDLSubscribeButton.h +++ b/SmartDeviceLink/SDLSubscribeButton.h @@ -1,12 +1,12 @@ // SDLSubscribeButton.h // - +#import "SDLButtonName.h" +#import "SDLNotificationConstants.h" #import "SDLRPCRequest.h" -#import "SDLButtonName.h" -#import "SDLRequestHandler.h" +NS_ASSUME_NONNULL_BEGIN /** * Establishes a subscription to button notifications for HMI buttons. Buttons @@ -58,10 +58,7 @@ * Since SmartDeviceLink 1.0<br/> * See SDLUnsubscribeButton */ - -NS_ASSUME_NONNULL_BEGIN - -@interface SDLSubscribeButton : SDLRPCRequest <SDLRequestHandler> +@interface SDLSubscribeButton : SDLRPCRequest /** * Construct a SDLSubscribeButton with a handler callback when an event occurs. @@ -70,16 +67,16 @@ NS_ASSUME_NONNULL_BEGIN * * @return An SDLSubscribeButton object */ -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler; -- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCNotificationHandler)handler; +- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCButtonNotificationHandler)handler; /** * A handler that will let you know when the button you subscribed to is selected. * * @warning This will only work if you use SDLManager. */ -@property (copy, nonatomic) SDLRPCNotificationHandler handler; +@property (copy, nonatomic) SDLRPCButtonNotificationHandler handler; /** * @abstract The name of the button to subscribe to diff --git a/SmartDeviceLink/SDLSubscribeButton.m b/SmartDeviceLink/SDLSubscribeButton.m index 07a2fe65c..1a94caa37 100644 --- a/SmartDeviceLink/SDLSubscribeButton.m +++ b/SmartDeviceLink/SDLSubscribeButton.m @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithHandler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithHandler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self init]; if (!self) { return nil; @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCNotificationHandler)handler { +- (instancetype)initWithButtonName:(SDLButtonName)buttonName handler:(nullable SDLRPCButtonNotificationHandler)handler { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index 9ca9975b4..ce6b9d5d4 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -309,7 +309,6 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "NSNumber+NumberType.h" #import "SDLErrorConstants.h" #import "SDLNotificationConstants.h" -#import "SDLRequestHandler.h" // Notifications #import "SDLRPCNotificationNotification.h" |