1

I am trying to open google maps using the on-click key from a compound card, but I don't know what to include in the payload-URI key for app-launch. The documentation uses the example which is commented out, but I do not know what to fill in for the application(google-maps).

I am getting two errors both being Unknown key message/app-launch.

This is the code we are trying to use, so that when a compound card is clicked, it opens google maps with app-launch.

// PersonSelectionView.view.bxb
input-view {
  match: Spot (this)

  // optional selection dialog to overwrite any other default dialog
  message (Pick a spot)

  render {
    // used to iterate over the list of candidates
    selection-of (this) {
      navigation-mode {
        read-none {
          list-summary ("There are #{size(this)} #{value(categories)} spots near you")
          item-selection-question (Which one would you like?)
        }
      }
      where-each (one) {
        // you can use conditional logic to control how candidates are displayed,
        // using either a standard layout with a match pattern, or a layout macro
        compound-card {
          content {
            map-card {
              title-area {
                slot1 {
                  text {
                    value("#{value (one.spotName)}")
                  }
                }
                slot3 {
                  single-line {
                    text {
                      value("#{value (one.distance)} Miles away")
                    }
                  }
                }
              }
              aspect-ratio (1:1)
              markers {
                marker {
                  geo ("Location.point")
                  icon {
                    template (/images/icons/red-marker.png)
                  }
                  width (15)
                  height (20)
                  anchor-x (5)
                  anchor-y (15)
                  rotation (0)
                }
              }
            }
            paragraph {
              value {
                template ("#{raw(description)}")
              }
              style (Detail_L)
            }
          }
          on-click {
            message ("TESTING THIS MESSAGE")
            app-launch {
              //payload-uri ("bixby://com.android.systemui/DummySystem/punchOut")
            }
          }
        }
      }
    }
  }
}

2 Answers2

0

An "Unknown Key" error means that the key you are trying to define is not one of the valid child keys of the key you are currently in. The reference section of the Bixby Developer Documentation provides each key with its valid child keys.

Both app-launch and message are not child keys of on-click.

  • app-launch cannot be defined within an on-click. It must be defined in its own result-view.

  • message can be defined in multiple keys but not on-click

Your on-click would need to redirect to a separate result-view which would contain the app-launch key with the correct payload-uri defined.

You would need the following to implement the behavior you described:

  • An Action (and backing Action Javascript) to return the URI
  • A Concept to hold the URI returned by the Action
  • A result-view with a match that matches the Concept

Example Action:

action (LaunchDefinedUri) {
  description (Launches the defined uri)
  type (Commit)
  collect {
    input (launchUri) {
      type (LaunchUri)
      min (Required) max (One)
    }
  }
  output (LaunchUri)
}

Example Action Javascript:

module.exports = {
  function: LaunchDefinedUri
}

function LaunchDefinedUri(launchUri) {
  return launchUri
}

Example Concept:

text (LaunchUri) {
  description (Uri to be launched)
}

Example Result View:

result-view {
  match: LaunchUri(this)

  app-launch {
    payload-uri("#{value(this)}")
  }

  render {
    nothing
  }
}

As for Google Maps API in particular, the Google Maps documentation seems to provide information on how to define the correct URIs for your specific purpose and behavior.

Ameya
  • 880
  • 6
  • 13
0

Please look into this official library provided by the Bixby team, which provides punch-out to Google Maps.

https://bixbydevelopers.com/dev/docs/dev-guide/developers/library.navigation

dogethis
  • 519
  • 6
  • 15