Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23732] Windows:Unable to set instantMessage property of a contact

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2021-02-11T12:18:40.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sn/a
ComponentsWindows
Labelsqe-5.4.0
ReporterEwan Harris
AssigneeUnknown
Created2016-08-04T18:16:06.000+0000
Updated2021-02-11T12:18:40.000+0000

Description

Description

Unable to set instantMessage property of a contact
function logContactDetails(searchName) {
	var singleValue = [
	  'recordId', 'firstName', 'middleName', 'lastName', 'fullName', 'prefix', 'suffix', 
	  'nickname', 'firstPhonetic', 'middlePhonetic', 'lastPhonetic', 'organization', 
	  'jobTitle', 'department', 'note', 'birthday', 'created', 'modified', 'kind'
	];
	var multiValue = [
	  'email', 'address', 'phone', 'instantMessage', 'relatedNames', 'date', 'url'
	];

	var people = Ti.Contacts.getPeopleWithName(searchName);
	console.log(people.length);
	for (var i=0, ilen=people.length; i<ilen; i++){
	  Ti.API.info('---------------------');
	  var person = people[i];
	  for (var j=0, jlen=singleValue.length; j<jlen; j++){
	    Ti.API.info(singleValue[j] + ': ' + person[singleValue[j]]);
	  }
	  for (var j=0, jlen=multiValue.length; j<jlen; j++){
	    Ti.API.info(multiValue[j] + ': ' + JSON.stringify(person[multiValue[j]]));
	  }
	}
}

//Request authorization
Ti.Contacts.requestAuthorization(function(e) {
    if (e.success) {
        Ti.API.info('auth request success');
        Ti.API.info(JSON.stringify(e));
        var person = Ti.Contacts.createPerson({
	      firstName: 'Steven',
	      lastName: 'Gerrard',
	      organization: 'Liverpool FC',
	      phone:{
	        mobile: ['07900 000001', '07900 000002'],
	        work: ['+44 (0)118 925 6128', '+44 (0)118 000 0000']
	      },
	      instantMessage:{
	  	    home:[{service: 'Skype',username: 'StevenGerrard'}],
		    work:[{service: 'Skype',username: 'StevenGerrard8'}]
		  }
		 });
		 Ti.Contacts.save();
		 setTimeout(function(){logContactDetails('Gerrard');}, 5000);
    } else {
        Ti.API.info('auth request fail');
        Ti.API.info(e);
    }
});

Steps to reproduce

Add the code above to an existing app.js

Build for Windows platform

Check logs

Actual result

The instantMessage property is empty

Expected result

The instantMessage property should not be empty

Comments

No comments

JSON Source