4

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.

Reys
  • 43
  • 2

2 Answers2

2

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) }
           }
         } 
       }
     }
  • Yes, and make sure to request the permissions to access the user's current location in your capsule.bxb file: `permissions { user-profile-access }` – Ellesmera Dec 21 '18 at 18:48
1

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)