react-native-carplay
react-native-carplay copied to clipboard
POI example crash the app with error: Unsupported object <CPPointOfInterestTemplate:....
Hi,
I am trying to use POI template same as in examples but app crash:
import {
CarPlay, PointOfInterestTemplate
} from 'react-native-carplay';
const template = new PointOfInterestTemplate({
title: 'Example',
items: [
{
id: 'test',
location: { latitude: 64.011, longitude: -21.66 },
title: 'Testing',
subtitle: 'foobar',
},
],
});
CarPlay.setRootTemplate(template, false);
But error that I get is:

If this is not possible I tried something else:

CarMapView() {
return (
<View style={{ flex: 1}} >
<MapView
style={{flex: 1}}
provider={PROVIDER_GOOGLE}
showsUserLocation={true}
followsUserLocation={true}>
<View style={{backgroundColor: '#f00', padding: 30, marginLeft: 50}}>
<TouchableOpacity style={{backgroundColor: '#0ff'}} onPress={() => {CarPlay.pushTemplate(someOtherTemplate);}}>
<Text>ITEM A</Text>
</TouchableOpacity>
</View>
</MapView>
</View>
);
}
const mapTemplate = new MapTemplate({
component: this.CarMapView
});
CarPlay.setRootTemplate(mapTemplate, false);
but this doesn't catch touch event on button over map. Any idea?
Pull Request Test Coverage Report for Build 133
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 63.636%
| Totals | |
|---|---|
| Change from base Build 101: | 0.0% |
| Covered Lines: | 32 |
| Relevant Lines: | 42 |
💛 - Coveralls
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.