The object that manages communication with the vehicles
you manufacture.
A `CarKeyRemoteControlSession` object coordinates interactions
between your app and your company's make of vehicles.
This object works with the system to transmit data securely to
and from a vehicle, and to report results back to your app. Use
this object to send commands or data directly to a vehicle, and
to get information about the available vehicles and their current
configuration.
Don’t create this object directly. Instead, call the
``CarKeyRemoteControl/start(delegate:subscriptionRange:with:)``
method to create a new session object. When you finish interacting with
the vehicle, call the session’s ``CarKeyRemoteControlSession/end()``
method to close out the session and prevent further access. You can have
only one active session at a time. If you try to start a second
session, ``CarKeyRemoteControl/start(delegate:subscriptionRange:with:)``
doesn't return until the currently active session becomes invalid.
When you configure a new session, provide a delegate object to receive
data from vehicle-initiated transfers. The system also uses your delegate
notify you when the configuration of a vehicle changes. For example,
it lets you know when connectivity to the vehicle changes. The delegate
must adopt the ``CarKeyRemoteControlSessionDelegate`` protocol.
- Note: If your app has an active session, the system automatically
ends that session when your app enters the background. Upon reentering
the foreground, you must create a new session to communicate with your
vehicle again.
Members (8)
get · iOS 16.0+
vehicleReports
TypeScript
get vehicleReports(): Array<VehicleReport>
Swift declaration
var vehicleReports: [VehicleReport] { get throws }
The configuration details of the provisioned vehicles that
match your company’s make.
The system maintains a cache of provisioned vehicles and updates
that information when the configuration details change.
Sends the specified custom data to the vehicle.
Use this method to send data that is custom to your specific vehicle.
This method passes the data unmodified directly to the vehicle, and
it is up to you to format the data exactly how the vehicle needs it.
If the vehicle sends a custom response, the system delivers it to
the ``CarKeyRemoteControlSessionDelegate/remoteControlSession(_:didReceivePassthroughData:fromVehicle:)``
method of your session’s delegate object.
- Parameters:
- passthroughData: The custom data to send to the vehicle. Make
sure the size of your data object doesn’t exceed 65 kilobytes.
- vehicleID: The target vehicle for the request. Choose the vehicle
from one of the session’s vehicle reports. Specify the string in the
``VehicleReport/identifier`` property of the corresponding report.
Returns a Boolean value that indicates whether passive entry is
currently available for the specified vehicle.
- Parameter vehicleID: The target vehicle for the request. Choose the
vehicle from one of the session’s vehicle reports. Specify
the string in the ``VehicleReport/identifier`` property of the corresponding
report.
- Returns: `true` if passive entry is available, or `false` if the
feature is not available.
method · iOS 16.0+
end
TypeScript
end(): void
Swift declaration
func end() throws
Ends the session and stops the delivery of notifications
for all vehicles in the session.
When you no longer need to access the vehicle information,
call this method to end the session. If the session isn’t
currently active when you call this method, it throws an error.
The system automatically ends a session when your app enters
the background. Upon reentering the foreground, you must create
a new session to communicate with your vehicle again.
Sign data with the endpoint.SK identified by vehicleIdentifier
as described in the section "OEM App Data Attestation" of
the Car Connectivity Consortium Digital Key Release 3.0 specification.
This method can only be used while the application is in the foreground.
- Parameter data: The OEM App Data to sign.
- Parameter vehicleID: The vehicle identifier.
- Returns: An Attestation object.
Sends a request to the vehicle to start an action that has a
separate stopping point, and optionally allows your app to
have control over incoming continuation requests and to
exchange data during the execution of the action.
Call this method for vehicle features that that have both a start
and stop point. For example, use it to start raising or lowering
the top of a convertible. This method sends the request to the
vehicle asynchronously.
Use the returned object to get the execution status of the initial
request, and to optionally stop the action.
- Parameter action: The action to perform. Use this object to specify the
action to perform and the vehicle on which to perform it.
- Parameter continuationStrategy: The continuation strategy.
- Returns: An object you use to get the results of the initial
request and stop the action.
Sends a request to the vehicle to perform a one-time action.
Call this method when the vehicle feature involves a one-time action.
For example, use it to lock the doors of the vehicle. This method sends
the request to the vehicle asynchronously.
Use the returned object to get the execution status of the specified
request. The execution status indicates whether the vehicle completed
the action successfully or an error occurred.
- Parameter action: The one-time action to perform. Use this object to
specify the action you want to perform and the vehicle on which
to perform it.
- Returns: An object you use to get the results of the request.
Sends a request to the vehicle to start an action that has a
separate stopping point.
Call this method for vehicle features that that have both a start
and stop point. For example, use it to start raising or lowering
the top of a convertible. This method sends the request to the
vehicle asynchronously.
Use the returned object to get the execution status of the initial
request, and to optionally stop the action.
- Parameter action: The action to perform. Use this object to specify the
action to perform and the vehicle on which to perform it.
- Returns: An object you use to get the results of the initial
request and stop the action.