Bixby 如何在self.self对象中填充addressInfos对象
我正在尝试从用户的个人资料中获取用户的设置家庭地址。当在设备上测试时,当它在配置文件中设置时,我始终看到它是空的 以下是用于提取信息的操作:Bixby 如何在self.self对象中填充addressInfos对象,bixby,Bixby,我正在尝试从用户的个人资料中获取用户的设置家庭地址。当在设备上测试时,当它在配置文件中设置时,我始终看到它是空的 以下是用于提取信息的操作: action (ReturnSelfAddress) { type (Constructor) description (Gets address from profile) collect { input (mySelf) { min (Required) type (self.Self) } }
action (ReturnSelfAddress) {
type (Constructor)
description (Gets address from profile)
collect {
input (mySelf) {
min (Required)
type (self.Self)
}
}
output (geo.SearchTerm)
}
这与从self.addressInfos
字段中提取home
地址的javascript文件一起使用
以下是我在设备上的个人资料截图:
还有另一个地址。
在测试中,我使用的是真实地址
我从配置文件中得到的结果自我对象是:
{
addressInfos = [],
birthdayInfo = {
calculatedFromNow = null,
day = 1,
fuzzyFactor = null,
holiday = null,
month = 1,
namedDate = null,
parseTree = null,
year = 1911,
$id = null,
$type = viv.contact.BirthdayInfo
},
contactId = null,
emailInfos = [{
address = fake@fake.com,
emailType = Home,
$id = null,
$type = viv.contact.EmailInfo
}],
isFavorite = null,
nameInfo = {
firstName = Bill,
initial = null,
lastName = Faker,
middleName = null,
nickName = ,
prefix = null,
structuredName = Bill Faker,
suffix = null,
$id = null,
$type = viv.contact.NameInfo
},
phoneInfos = [],
photoInfo = {
caption = null,
dimensions = null,
rotation = null,
size = null,
subtitle = null,
title = null,
url = http://image.to.be.put/here,
$id=null, $type=viv.contact.PhotoInfo
},
relationshipInfos=[],
workInfo=null,
$id=null,
$type=viv.self.Self
}
如您所见,addressInfos
数组为空。我应该如何访问用户的配置文件地址
编辑:
这里的个人信息是我编造的虚拟数据,所以我不必分享我的实际电子邮件、生日、电话号码等。。。在我的设备上实际测试时,所有这些信息都与我的real developer帐户相匹配。请仔细检查您的三星帐户中是否填写了地址:
viv.self.self链接到三星帐户 在设备上,设置->右上角,您将能够编辑您的三星帐户。 我刚刚添加了一个工作地址,可以使用下面的JS代码访问它
module.exports.function = function displayProfile (self) {
console.log(self)
if (self)
return 'lable = ' + self.addressInfos[0].label + ' address = ' + self.addressInfos[0].address.unstructuredAddress;
else
return 'Not self';
}
当前的IDE能够从您的三星帐户获取这些信息,因此您可以在不进行设备测试的情况下进行测试。当然,我也在私人提交后在设备上进行了测试,效果很好 它没有设置,但我已经设置了,仍然得到空的addressInfos。另外,为什么AddressInfo不能基于您的bixby配置文件中的地址?您能否确认emailInfo.address=fake@fake.com测试设备上设置了正确的配置文件?问题最终是胶囊版本错误。我使用的是
viv.self:version(3.5.1)
,需要使用viv.self:version(3.5.41)
。故事的寓意是,始终确保你拥有最新的图书馆胶囊。