This sample capsule is a quick demonstration of the $vivContext
variable for passing user context information.
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.vivContext
to acme.vivContext
.
After you compile the NL, you can run this query in the Simulator to see the value of $vivContext
: "Show user context".
This parameter declaration makes $vivContext
available to the JavaScript action implementation:
// Request access to the $vivContext by declaring it as a parameter
export default function accessVivContext({ $vivContext }) {
return JSON.stringify($vivContext, undefined, 1);
}
$vivContext.bixbyUserId
will be null
by default. In order to access the value, you must request this permission in your capsule.bxb
file:
permissions {
bixby-user-id-access
}
The following video tutorial describes several ways to use the $vivContext
variable with the user-context
sample capsule.
Copyright 2024 Samsung All rights reserved