TypeScript API
Carplayinterface

Class: CarPlayInterface

A controller that manages all user interface elements appearing on your map displayed on the CarPlay screen.

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new CarPlayInterface(): CarPlayInterface

Returns

CarPlayInterface

Defined in

packages/react-native-carplay/src/CarPlay.ts:148 (opens in a new tab)

Properties

bridge

bridge: InternalCarPlay = RNCarPlay

React Native bridge to the CarPlay interface

Defined in

packages/react-native-carplay/src/CarPlay.ts:132 (opens in a new tab)


connected

connected: boolean = false

Boolean to denote if carplay is currently connected.

Defined in

packages/react-native-carplay/src/CarPlay.ts:137 (opens in a new tab)


emitter

emitter: NativeEventEmitter

CarPlay Event Emitter

Defined in

packages/react-native-carplay/src/CarPlay.ts:143 (opens in a new tab)


onConnectCallbacks

Private onConnectCallbacks: Set<OnConnectCallback>

Defined in

packages/react-native-carplay/src/CarPlay.ts:145 (opens in a new tab)


onDisconnectCallbacks

Private onDisconnectCallbacks: Set<OnDisconnectCallback>

Defined in

packages/react-native-carplay/src/CarPlay.ts:146 (opens in a new tab)


window

window: undefined | WindowInformation

Defined in

packages/react-native-carplay/src/CarPlay.ts:138 (opens in a new tab)

Accessors

rootTemplate

get rootTemplate(): Promise<string>

The current root template in the template navigation hierarchy.

Returns

Promise<string>

Todo

Not implemented yet

Defined in

packages/react-native-carplay/src/CarPlay.ts:263 (opens in a new tab)


topTemplate

get topTemplate(): Promise<string>

The top-most template in the navigation hierarchy stack.

Returns

Promise<string>

Todo

Not implemented yet

Defined in

packages/react-native-carplay/src/CarPlay.ts:271 (opens in a new tab)

Methods

dismissTemplate

dismissTemplate(animated?): void

Dismisses the current presented template *

Parameters

NameTypeDefault valueDescription
animatedbooleantrueA Boolean value that indicates whether the system animates the display of transitioning templates.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:255 (opens in a new tab)


enableNowPlaying

enableNowPlaying(enable?): void

Control now playing template state

Parameters

NameTypeDefault valueDescription
enablebooleantrueA Boolean value that indicates whether the system use now playing template.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:279 (opens in a new tab)


popTemplate

popTemplate(animated?): void

Pops the top template from the navigation stack and updates the display.

Parameters

NameTypeDefault valueDescription
animatedbooleantrueA Boolean value that indicates whether the system animates the display of transitioning templates.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:238 (opens in a new tab)


popToRootTemplate

popToRootTemplate(animated?): void

Pops all templates on the stack—except the root template—and updates the display.

Parameters

NameTypeDefault valueDescription
animatedbooleantrueA Boolean value that indicates whether the system animates the display of transitioning templates.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:230 (opens in a new tab)


popToTemplate

popToTemplate(targetTemplate, animated?): void

Pops templates until the specified template is at the top of the navigation stack.

Parameters

NameTypeDefault valueDescription
targetTemplatePushableTemplatesundefinedThe template that you want at the top of the stack. The template must be on the navigation stack before calling this method.
animatedbooleantrueA Boolean value that indicates whether the system animates the display of transitioning templates.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:222 (opens in a new tab)


presentTemplate

presentTemplate(templateToPresent, animated?): void

presents a presentable template, alert / action / voice

Parameters

NameTypeDefault valueDescription
templateToPresentPresentableTemplatesundefinedThe presentable template to present
animatedbooleantrueA Boolean value that indicates whether the system animates the display of transitioning templates.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:247 (opens in a new tab)


pushTemplate

pushTemplate(templateToPush, animated?): void

Pushes a template onto the navigation stack and updates the display.

Parameters

NameTypeDefault valueDescription
templateToPushPushableTemplatesundefinedThe template to push onto the navigation stack.
animatedbooleantrueSet TRUE to animate the presentation of the template.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:213 (opens in a new tab)


registerOnConnect

registerOnConnect(callback): void

Fired when CarPlay is connected to the device.

Parameters

NameType
callbackOnConnectCallback

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:180 (opens in a new tab)


registerOnDisconnect

registerOnDisconnect(callback): void

Fired when CarPlay is disconnected from the device.

Parameters

NameType
callbackOnDisconnectCallback

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:191 (opens in a new tab)


setRootTemplate

setRootTemplate(rootTemplate, animated?): void

Sets the root template, starting a new stack for the template navigation hierarchy.

Parameters

NameTypeDefault valueDescription
rootTemplateTabBarTemplate | PushableTemplatesundefinedThe root template. Replaces the current rootTemplate, if one exists.
animatedbooleantrueSet TRUE to animate the presentation of the root template; ignored if there isn't a current rootTemplate.

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:204 (opens in a new tab)


unregisterOnConnect

unregisterOnConnect(callback): void

Parameters

NameType
callbackOnConnectCallback

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:184 (opens in a new tab)


unregisterOnDisconnect

unregisterOnDisconnect(callback): void

Parameters

NameType
callbackOnDisconnectCallback

Returns

void

Defined in

packages/react-native-carplay/src/CarPlay.ts:195 (opens in a new tab)