Bixby Developer Center

Guides
References

Refreshing Content

This sample capsule demonstrates how to implement a refresh use case, using a ride sharing capsule as an example.

Download Capsule

Note

Because you cannot submit a capsule with the example namespace, in order to test a sample capsule on a device, you must change the id in the capsule.bxb file from example to your organization's namespace before making a private submission.

For example, if your namespace is acme, change example.refresh to acme.refresh.

In this particular sample, it uses a ride share example. The refresh uses the goal: CheckRideShareStatus as the intent. The UI then periodically refreshes to show how far away the current ride is, with an updated message for the user each time it's refreshed.

The refresh is implemented in the result-view, refreshing the interface at five second intervals:

  refresh {
if (this.countdown != 0) {
spec {
delay-seconds (5)
with-request {
intent {
goal: CheckRideShareStatus
value {
$expr (this)
}
}
}
}
}
}

View 5c44a27c3ef5daa1f9f9f20c8316840f71c0a333 on GitHub

For more information, see Refreshing Your Content.