3

I am trying to get the user's set home address from their profile. When testing on device, am consistently seeing it empty when it is set in the profile.

Here is the action used to extract the information:

action (ReturnSelfAddress) {
  type (Constructor)
  description (Gets address from profile)
  collect {
    input (mySelf) {
      min (Required)
      type (self.Self)
    }
  }
  output (geo.SearchTerm)
}

This goes along with a javascript file that extracts the home address from the self.addressInfos field.

Here is a screenshot of my profile on the device: Profile

And another of the address. Profile

In testing I was using a real address.

The resulting self object I got from the profile was:

{
    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
}

As you can see the addressInfos array is empty. How should I access the user's profile addresses?

EDIT: The personal information here is dummy data I made up so I wouldn't have to share my actual email, birthday, phone number etc... When actually testing this on my device, all of this information matches my real developer account.

Ami Berger
  • 59
  • 6
  • can you confirm if the emailInfo.address = fake@fake.com the correct profile set on your testing device? – BixbyDevSupport-Tokonyan Jun 03 '19 at 19:52
  • The issue ended up being the wrong capsule version. I was using `viv.self: version (3.5.1)` and needed to be using `viv.self: version (3.5.41)`. Moral of the story, always make sure you have the most up to date library capsules. – Ami Berger Jun 04 '19 at 18:22

2 Answers2

1

Please double-check that you have an address filled out in your Samsung account: https://www.samsung.com/us/support/account/info/

Geoff Wong
  • 11
  • 2
  • It was not set, but I have set it and still am getting empty addressInfos. Also, why wouldn't addressInfos be based on the addresses in your bixby profile? – Ami Berger Jun 03 '19 at 12:43
1

viv.self.Self is linked to Samsung account.

On device, Settings -> Upper right corner, you will be able to edit your Samsung account. I've just added a work address, and able to access it using the following JS code.

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 Screenshot

Current IDE is able to fetch these info from your Samsung account, so you can test without on-device testing. Of course, I've also tested on device after private submission, and it works fine.