1. Create a default classic app & replace the app/js with the following code:
var photo = Ti.UI.createImageView({
image: 'KS_nav_views.png'
}).toBlob();
var person = Ti.Contacts.createPerson({
firstName: 'Aaron',
lastName: 'Smith',
date: {
anniversary: ['2002-11-11T11:23:30.000+0000'],
other: ['2011-04-02T12:00:00.000+0000']
}
});
person.organization = "google";
person.phone = {
mobile: ['9999999991', '1234556677'],
work: ['9999998888', '1234567789']
};
person.address = {
work:[
{
Street: '900 West Drive',
City: 'New York',
County: 'Berkshire',
Country: 'U.S.A',
ZIP: '99999'
},
{
Street: '456 New Ave.',
City: 'San Jose',
State: 'California',
Country: 'U.S.A',
ZIP: '94082'
}
],
home:[
{
Street: '2 East Drive',
City: 'Las Vegas',
State: 'Nevada',
Country: 'U.S.A',
ZIP: '55555'
}
]};
person.instantMessage = {
home:[
{
service: 'AIM',
username: 'Dominator'
},
{
service: 'MSN',
username: 'dominator@msn.com'
}
],
work:[
{
service: 'Facebook',
username: 'Dominator2'
}
]
};
person.url = {
homepage: ['www.myspace.com'],
work: ['www.apple.com', 'www.yahoo.com']
};
person.email = {
home: ['hieu@google.com'],
work: ['pham@google.com', 'hp007@appcelerator.com']
};
person.relatedNames = {
parent: ['daddy', 'mommy'],
assistant: ['mayhem']
};
person.date = {
anniversary: ['2022-11-11T11:23:30.000+0000'],
other: ['2003-04-02T12:00:00.000+0000']
};
person.firstName = "Ade";
person.lastName = "Crude";
person.birthday = "1999-01-01T12:00:00.000+0000";
person.organization = "GOOGLE";
person.note = "NOTE: MASS EFFECT";
person.nickname = "NICKNAME: THOR";
person.image = photo;
Ti.Contacts.save([person]);
2. Build & run the app on android device.
3. Open contacts on the device & check if you have a new contact
Ade Crude" added.
1.A new contact "Ade Crude" is not added to the contacts list on the device.
To confirm, this works on Android 5.0 with 3.3.0.GA, and fails on Android 5.0 with 3.4.0.GA? Is there a reason this is not labelled a regression?
This issue is not limited to android 5.0. It's also seen on an android 4.4.2 device. Yes, this is a regression which got introduced in 3.4.0.GA as 3.3.0.GA does not have this issue.
Forgot to assign the bug to me but I was looking into this. Here is the PR https://github.com/appcelerator/titanium_mobile/pull/6290
https://github.com/appcelerator/titanium_mobile/pull/6290
3_4_X PR: https://github.com/appcelerator/titanium_mobile/pull/6314
Verified the fix. The contact is successfully created on the device.\ Closing. Environment: Appc Studio : 3.4.1.201410281743 Ti SDK : 3.5.0.v20141124092514, 3.4.2.v20141117130125 CLI : 3.4.1 Alloy : 1.5.1 GA Code Processor : 1.1.1 MAC Yosemite : 10.10 Nexus 5 - Android 5.0