如何测试访问用户配置文件的胶囊?

问题描述 投票:1回答:2

我有兴趣制作一个胶囊,用于从他们的个人资料中提取用户的电子邮件和地址等信息。根据this,似乎这完全有可能,但有没有办法在模拟器中创建用户配置文件并进行测试?

bixby bixbystudio
2个回答
2
投票

在这种情况下,self.GetImaginarySelf方法可能很有用。这没有记录,但似乎返回了可以使用的Self对象。

enter image description here

这就是它看起来如何enter image description here

action (ReturnMySelf) {
  type(Constructor)
  description (__DESCRIPTION__)
  collect {
    computed-input (mySelf) {
      type (self.Self)
      compute {
        intent {
          goal: self.GetImaginarySelf
        }
      }
    }
  }
  output (self.Self)
}

Javascript代码

module.exports.function = function returnMySelf (mySelf) {
  return mySelf
}

如果这些值不适合您,您可以构造Self对象的JSON表示(具有所需的值)并将其从returnMySelf.js传回。

希望这可以帮助!


3
投票

不幸的是,Bixby IDE无法测试viv.self或viv.contact。

但是,您可以按照以下步骤在任何Bixby启用手机上进行设备上测试,例如S9。

  1. 在IDE中开发您的胶囊。
  2. 做胶囊的private submission
  3. 使用版本ID启用on-device testing和加载封装。

设备上的测试不如在IDE中编译和运行那么简单,而是每个胶囊开发中的必要步骤。与Bixby玩得开心!

© www.soinside.com 2019 - 2024. All rights reserved.