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:162 (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:146 (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:151 (opens in a new tab)


emitter

• emitter: NativeEventEmitter

CarPlay Event Emitter

Defined in

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


onConnectCallbacks

• Private onConnectCallbacks: Set<OnConnectCallback>

Defined in

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


onDisconnectCallbacks

• Private onDisconnectCallbacks: Set<OnDisconnectCallback>

Defined in

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


window

• window: undefined | WindowInformation

Defined in

packages/react-native-carplay/src/CarPlay.ts:152 (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:277 (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:285 (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:269 (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:293 (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:252 (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:244 (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:236 (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:261 (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:227 (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:194 (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:205 (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:218 (opens in a new tab)


unregisterOnConnect

▸ unregisterOnConnect(callback): void

Parameters

NameType
callbackOnConnectCallback

Returns

void

Defined in

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


unregisterOnDisconnect

▸ unregisterOnDisconnect(callback): void

Parameters

NameType
callbackOnDisconnectCallback

Returns

void

Defined in

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