Bixby Developer Center

Guides

2018 July–September

Note

Internal platform changes that are not visible to capsule developers will be communicated via internal status updates.

18Q Capsule SDK Release Notes

"input" and "collection" Layouts Deprecated

We've deprecated input and collection layouts. You should now use the input-view and result-view components instead.

Input Layout - Old, Deprecated

Person_input.layout.bxb

<layout type="input">
<match> Person (this) </match>
<content>
<div class="passenger">
<div>
<table>
<tr>
<td><viv:Input value="{{this.firstName}}" placeholder="First Name" /></td>
<td><viv:Input value="{{this.lastName}}" placeholder="Last Name" /></td>
</tr>
</table>
</div>
</div>
</content>
</layout>

Input View - New

Person_input.view.bxb

input-view {
match: Person (this)

// optional message
message (Enter your first and last name)

render {
form {
on-submit {
goal: test.maycapsule.Person
value: test.maycapsule.Person {
firstName: viv.core.FormElement(firstName)
lastName: viv.core.FormElement(lastName)
}
}
elements {
text-input {
id ("firstName")
label (First Name)
type (FirstName)
max-length (15)
value ("#{raw(this.firstName)}")
}
text-input {
id ("lastName")
label (Last Name)
type (LastName)
max-length (15)
value ("#{raw(this.lastName)}")
}
}
}
}
}

Collection Layout - Old, Deprecated

Song_result.collection.bxb

Called for a collection of results (more than 1).

collection {
match: Song (this)

smart-picks {
smart-pick {
filter (numberOfPlays >= 10)
sort-order { sort-key (DESC) {binding(userRating)} sort-key (ASC) {binding(title)} }
label {
template("Highest Rated")
}
}

smart-pick {
sort-order { sort-key (DESC) {binding(numberOfPlays)} sort-key (ASC) {binding(title)} }
label {
template("Most played")
}
}

smart-pick {
sort-order { sort-key (DESC) {binding(popularity)} sort-key (ASC) {binding(title)} }
label {
template("Hot right now")
}
}
}

conversation-drivers {
conversation-driver {
template ("Favorites")
}
conversation-driver {
template ("Jazz")
}
conversation-driver {
template ("Recent additions")
}
}
}

Result View - New

Song_result.view.bxb

Called for 0, 1 or many results. Refresh is supported, but grouping no longer is.

result-view {
match: Song (this)

render {
if (size(this) > 1) {
// specify how a set of results will be rendered
list-of (this) {

// smart-picks -> highlights
highlights {
select (pick) {
label (Highest rated)
filter-by (pick.numberOfPlays > 10)
order-by {
sorting (pick.userRating) {
inverted
}
sorting (title)
}
layout-macro (highlight-macro) {
song(pick)
}
}
select (pick) {
label (Most played)
order-by {
sorting (pick.numberOfPlays) {
inverted
}
sorting (title)
}
layout-macro (highlight-macro) {
song(pick)
}
}
select (pick) {
label (Hot right now)
order-by {
sorting (pick.popularity) {
inverted
}
sorting (title)
}
layout-macro (highlight-macro) {
song(pick)
}
}
}

// support for defining hands-free behavior
hands-free-page-size(3)
where-each-page (page) {
where-each-item {
layout-match (pick) {
mode (Summary)
}
}
}
}
} else-if (size(this) == 1) {
// specify how a single result will be rendered
layout-match (this) {
mode (Details)
}
}
}

conversation-drivers {
if (size(this) > 1) {
conversation-driver {
template ("Favorites")
}
conversation-driver {
template ("Jazz")
}
conversation-driver {
template ("Recent additions")
}
}
}
}

"group-by" within "default-sort-order" Deprecated

The group-by key within default-sort-order has been deprecated.

This key exists within collection, input-view, and result-view.

"allow-external-sources" Deprecated

The allow-external-sources key has been deprecated.

Changes to Activity Support

If your capsule uses activity-support, all control flow must terminate in the state key to guarantee that your activity always has a well-defined state. This means that every if must declare an ending else block and every switch needs a default case.

Additionally, match patterns within activity-support (*-support files) cannot use cardinality constraints or match pattern links.

18P Capsule SDK Release Notes

Requirements for Unique Macro IDs

While you can have layout and dialog macros with the same ID within different targets (for example, bixby-mobile-ko-KR and bixby-mobile-en-US), you cannot have macros with the same ID if defined in the same resource folder.

Macros for higher level resourced buckets (such as bixby-mobile-en), however, can be overridden by those at lower levels (such as bixby-mobile-en-US).

Read more about Reusing Content with Macros in the Developers' Guides.

18O Capsule SDK Release Notes

New Function and JS Variable for Checking User Permission Grants

A new permissionsGranted(permission) function is available to check if a specified permission has been granted by the user:

output (Something) {
evaluate {
if("#{permissionGranted('user-profile-access')}") {
...
} else {
...
}
}
}

Additionally, you can check for this permission grant using the $vivContext.grantedPermissions variable in JavaScript:

var permissions = $vivContext.grantedPermissions
if ('user-profile-access' in permissions) {
console.log('PERMISSON GRANTED')
} else {
console.log('PERMISSION DENIED')
}

For more information, see the Grant Capsule Permissions section of Preparing Your Capsule in the Developers' Guide.

"title-area" Layout Macro Deprecated

We've deprecated the title-area layout macro from the UI Kit.

18N Capsule SDK Release Notes

Needed Access Permissions

To access user profile and location information, you must now get user permission using user-profile-access:

capsule {
...
permissions {
user-profile-access
}
}
capsule {
...
permissions {
user-profile-access
}
}

This currently required for $user.currentlocation.

Training Patterns

When you add training, you must now ensure that all training entries that are patterns are learned. Otherwise, submission will fail.

Training Requirements

In this release, user conversations no longer have a set of capsules that can be used exclusively with named-dispatch. The only capsules in user conversations will be those that the user's personal classifier is trained for, and they will support both natural utterances and named-dispatch.

New Documentation: Designing a Capsule

We've added a new Developers' Guide on Designing a Capsule. It gives a set of recommendations that you should think about and plan ahead of time before creating your capsules. It will help you figure out which models, actions, and general information you need while developing your capsule.

New Documentation: Activity Cards

We've added new documentation on how you can provide updates within Transactional Workflows using Activity Cards. Activity Cards give you an opportunity to provide updates in an activity. Any transaction that represents a "receipt" state is now considered an Activity.

For more information, read more about Updates with Activity Cards.

Bixby Developer System Status Board

We've introduced a system status board so that you can check whether Bixby services are normal, degraded, or down:

https://bixbydevelopers.statuspage.io/