The top level manager object for all of SDL’s interactions with the app and the head unit
The configuration the manager was set up with.
@property (nonatomic, copy, readonly) SDLConfiguration *_Nonnull configuration;
@NSCopying var configuration: SDLConfiguration { get }
The current HMI level of the running app.
@property (nonatomic, copy, readonly, nullable) SDLHMILevel hmiLevel;
var hmiLevel: SDLHMILevel? { get }
The current audio streaming state of the running app.
@property (nonatomic, copy, readonly) SDLAudioStreamingState _Nonnull audioStreamingState;
var audioStreamingState: SDLAudioStreamingState { get }
The current system context of the running app.
@property (nonatomic, copy, readonly) SDLSystemContext _Nonnull systemContext;
var systemContext: SDLSystemContext { get }
The file manager to be used by the running app.
@property (nonatomic, strong, readonly) SDLFileManager *_Nonnull fileManager;
var fileManager: SDLFileManager { get }
The permission manager monitoring RPC permissions.
@property (nonatomic, strong, readonly) SDLPermissionManager *_Nonnull permissionManager;
var permissionManager: SDLPermissionManager { get }
The streaming media manager to be used for starting video sessions.
@property (nonatomic, strong, readonly, nullable) SDLStreamingMediaManager *streamManager;
var streamManager: SDLStreamingMediaManager? { get }
The screen manager for sending UI related RPCs.
@property (nonatomic, strong, readonly) SDLScreenManager *_Nonnull screenManager;
var screenManager: SDLScreenManager { get }
Centralized manager for retrieving all system capabilities.
@property (nonatomic, strong, readonly) SDLSystemCapabilityManager *_Nonnull systemCapabilityManager;
var systemCapabilityManager: SDLSystemCapabilityManager { get }
The response of a register call after it has been received.
@property (nonatomic, strong, readonly, nullable) SDLRegisterAppInterfaceResponse *registerResponse;
var registerResponse: SDLRegisterAppInterfaceResponse? { get }
The auth token, if received. This should be used to log into a user account. Primarily used for cloud apps with companion app stores.
@property (nonatomic, strong, readonly, nullable) NSString *authToken;
var authToken: String? { get }
The manager’s delegate.
@property (nonatomic, weak, nullable) id<SDLManagerDelegate> delegate;
The currently pending RPC request send transactions
@property (nonatomic, copy, readonly) NSArray<__kindof NSOperation *> *_Nonnull pendingRPCTransactions;
var pendingRPCTransactions: [Operation] { get }
Initialize the manager with a configuration. Call startWithHandler
to begin waiting for a connection.
- (nonnull instancetype)
initWithConfiguration:(nonnull SDLConfiguration *)configuration
delegate:(nullable id<SDLManagerDelegate>)delegate;
Your app’s unique configuration for setup.
An optional delegate to be notified of hmi level changes and startup and shutdown. It is recommended that you implement this.
An instance of SDLManager
Start the manager, which will tell it to start looking for a connection. Once one does, it will automatically run the setup process and call the readyBlock when done.
- (void)startWithReadyHandler:(nonnull SDLManagerReadyBlock)readyHandler;
func start(readyHandler: @escaping SDLManagerReadyBlock)
The block called when the manager is ready to be used or an error occurs while attempting to become ready.
Stop the manager, it will disconnect if needed and no longer look for a connection. You probably don’t need to call this method ever.
If you do call this method, you must wait for SDLManagerDelegate’s managerDidDisconnect callback to call startWithReadyHandler:.
- (void)stop;
func stop()
Start the encryption lifecycle manager, which will attempt to open a secure service.
Please call this method in the successful callback of startWithReadyHandler. If you do call this method, you must wait for SDLServiceEncryptionDelegate’s serviceEncryptionUpdatedOnService delegate method before you send any encrypted RPCs.
- (void)startRPCEncryption;
func startRPCEncryption()
Send an RPC of type Response
, Notification
or Request
. Responses and notifications sent to Core do not a response back from Core. Each request sent to Core does get a response, so if you need the response and/or error, call sendRequest:withResponseHandler:
instead.
- (void)sendRPC:(nonnull __kindof SDLRPCMessage *)rpc;
func sendRPC(_ rpc: SDLRPCMessage)
An RPC of type SDLRPCResponse
, SDLRPCNotification
or SDLRPCRequest
Send an RPC request and don’t bother with the response or error. If you need the response or error, call sendRequest:withCompletionHandler: instead.
- (void)sendRequest:(nonnull SDLRPCRequest *)request;
func send(_ request: SDLRPCRequest)
The RPC request to send
Send an RPC request and set a completion handler that will be called with the response when the response returns.
- (void)sendRequest:(nonnull SDLRPCRequest *)request
withResponseHandler:(nullable SDLResponseHandler)handler;
func send(request: SDLRPCRequest, responseHandler handler: SDLResponseHandler? = nil)
The RPC request to send
The handler that will be called when the response returns
Send all of the requests given as quickly as possible, but in order. Call the completionHandler after all requests have either failed or given a response.
- (void)sendRequests:(nonnull NSArray<SDLRPCRequest *> *)requests
progressHandler:
(nullable SDLMultipleAsyncRequestProgressHandler)progressHandler
completionHandler:
(nullable SDLMultipleRequestCompletionHandler)completionHandler;
func send(_ requests: [SDLRPCRequest], progressHandler: SDLMultipleAsyncRequestProgressHandler?) async -> Bool
The requests to be sent
A handler called every time a response is received
A handler to call when all requests have been responded to
Send all of the requests one at a time, with the next one going out only after the previous one has received a response. Call the completionHandler after all requests have either failed or given a response.
- (void)sendSequentialRequests:(nonnull NSArray<SDLRPCRequest *> *)requests
progressHandler:
(nullable SDLMultipleSequentialRequestProgressHandler)
progressHandler
completionHandler:(nullable SDLMultipleRequestCompletionHandler)
completionHandler;
func sendSequential(requests: [SDLRPCRequest], progressHandler: SDLMultipleSequentialRequestProgressHandler?) async -> Bool
The requests to be sent
A handler called every time a response is received. Return NO to cancel any requests that have not yet been sent, YES to continue sending requests.
A handler to call when all requests have been responded to
Subscribe to callbacks about a particular RPC request, notification, or response with a block callback.
- (nonnull id)subscribeToRPC:(nonnull SDLNotificationName)rpcName
withBlock:(nonnull SDLRPCUpdatedBlock)block;
func subscribe(to rpcName: NSNotification.Name, block: @escaping SDLRPCUpdatedBlock) -> Any
The name of the RPC request, response, or notification to subscribe to.
The block that will be called every time an RPC of the name and type specified is received.
An object that can be passed to unsubscribeFromRPC:ofType:withObserver:
to unsubscribe the block.
Subscribe to callbacks about a particular RPC request, notification, or response with a selector callback.
The selector supports the following parameters:
- (void)registerAppInterfaceResponse
- (void)registerAppInterfaceResponse:(NSNotification *)notification;
Note that using this method to get a response instead of the sendRequest:withResponseHandler:
method of getting a response, you will not be notified of any SDLGenericResponse
errors where the head unit doesn’t understand the request.
- (void)subscribeToRPC:(nonnull SDLNotificationName)rpcName
withObserver:(nonnull id)observer
selector:(nonnull SEL)selector;
func subscribe(to rpcName: NSNotification.Name, observer: Any, selector: Selector)
The name of the RPC request, response, or notification to subscribe to.
The object that will have its selector called every time an RPC of the name and type specified is received.
The selector on observer
that will be called every time an RPC of the name and type specified is received.
Unsubscribe to callbacks about a particular RPC request, notification, or response.
- (void)unsubscribeFromRPC:(nonnull SDLNotificationName)rpcName
withObserver:(nonnull id)observer;
func unsubscribe(from rpcName: NSNotification.Name, observer: Any)
The name of the RPC request, response, or notification to unsubscribe from.
The object representing a block callback or selector callback to be unsubscribed