How to use navigation mode logically

2019-08-21 02:01发布

问题:

Though, I am using navigation mode in my app but i am not getting the expected results. Have asked related questions earlier but that didn't help. I am putting my point here one more time.

User will ask "Tell me the news"

Expectation

  • we will give user options like 1: sports news 2: Economy news 3: General news
  • User will select by saying second one Or user will click on the option
  • Will take input as Economy news and will give user few news in details

Actually happening

  • User will be given option and user choose second one.
  • Second option popped up again and then you have to click on that option to get news flash.

my result-view contains list-of, navigation-mode, where-each, layout-macro.
Right now, I have three file to achieve that.
NewsChoice_Result.view.bxb, NewsChoice.layout.bxb and NewsChoice_Details.layout.bxb

Scenario 2

Over here news.js has hard coded value and fixed option for the user... In my case i have to show user dynamic option based on input. For example.. ummmm... if user is saying that give me details about England football player. In this I will take England as input and fetch all the best player from England football team and provide user with 5 option. now user might select by saying first,second or third or simply click or user can say the name as well.. so it should go to result page.

I can't copy paste all the file here involved. So please let me know how do I achieve, what i wanted? Please let me know if you guys need any other information.

回答1:

The short answer is that this requires a multi-part solution:

  • Create a new Action that accepts zero inputs and outputs all the possible values you would like the user to select from to input into your original Action.
  • Add a default-init to your original Action's input collect that launches the new Action. This will ensure that, if no valid inputs are provided by the user's utterance, the new Action will be launched first
  • Create an input-view that lists out the values outputted by your new Action and requests the user to select one. Once this is done, your original Action will take over at this point.

I've created a sample capsule showing how this works and explaining it in greater detail on the Bixby Developers Help Center.

For more information, I would recommend reading about the Input Moment and Input Views as it will give you more context behind how Bixby's conversation flow works and how to implement it.

Hope this helps!