问题
I saw the dev guide of bixby studio and tested provided samples.
I want to some more complex (but very important) service such as the weather info based on my location.
Is this feature available in the current state of bixby studio? If possible, let me know how.
回答1:
Here is a snippet of code that might help you. Be sure to import the viv.geo library in your capsule.bxb file
import (viv.geo) { as (geo) version (9.0.6) } The latest version of capsule libraries is available here: https://bixbydevelopers.com/dev/docs/dev-guide/developers/library#capsule-versions
And the following code in your Action
input (myLocation) {
min (Required) max(One)
type (geo.NamedPoint)
default-init {
if ($user.currentLocation.$exists) {
intent {
goal: geo.NamedPoint
value-set: geo.CurrentLocation { $expr ($user.currentLocation) }
}
}
}
}
回答2:
If you want to get the information based on your current location - you may use $user.currrentLocation
while modelling Actions. It returns GeoPoint
type data you can use further. If you use the simulator - it can be customized on "User" tab (Ctrl + 2)
来源:https://stackoverflow.com/questions/53734621/bixby-how-to-get-informations-based-on-my-location-such-as-weather-etc