@iternio/react-native-auto-play 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -239,11 +239,19 @@ class MapTemplate(
239
239
  fun updateTripDestinations() {
240
240
  val tripDestinations = getTripDestinations()
241
241
  UiThreadUtil.runOnUiThread {
242
- navigationManager.updateTrip(Trip.Builder().apply {
242
+ val trip = Trip.Builder().apply {
243
243
  tripDestinations.forEach {
244
244
  addDestination(it.key, it.value)
245
245
  }
246
- }.build())
246
+ }.build()
247
+ try {
248
+ navigationManager.updateTrip(trip)
249
+ } catch(e: IllegalStateException) {
250
+ // Sometimes we get a "java.lang.IllegalStateException: Navigation is not started" here, although the navigation
251
+ // is started already (we check for isNavigating at the top). So i guess this is a race condition, that we start navigation
252
+ // and the AA app is not ready yet. Unfortunately we can not ask the AA app for it's state, so we just catch the error.
253
+ }
254
+
247
255
  }
248
256
  }
249
257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iternio/react-native-auto-play",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Android Auto and Apple CarPlay for react-native",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",