Skip to content

Commit

Permalink
Merge pull request #162 from janwiebe-jump/fix/issue-161
Browse files Browse the repository at this point in the history
Fixes #161
  • Loading branch information
birkir authored Feb 16, 2024
2 parents 5570faa + 25cec90 commit 9209cf6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/react-native-carplay/src/CarPlay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ImageSourcePropType, NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
import { ImageSourcePropType, NativeEventEmitter, NativeModule, NativeModules, Platform } from 'react-native';
import { ActionSheetTemplate } from './templates/ActionSheetTemplate';
import { AlertTemplate } from './templates/AlertTemplate';
import { ContactTemplate } from './templates/ContactTemplate';
Expand Down Expand Up @@ -161,11 +161,13 @@ export class CarPlayInterface {
callback();
});
});
this.emitter.addListener('didPressMenuItem', e => {
if (e?.title === 'Reload Android Auto') {
this.bridge.reload();
}
});
if (Platform.OS === 'android') {
this.emitter.addListener('didPressMenuItem', e => {
if (e?.title === 'Reload Android Auto') {
this.bridge.reload();
}
});
}

// check if already connected this will fire any 'didConnect' events
// if a connected is already present.
Expand Down

0 comments on commit 9209cf6

Please sign in to comment.