我在Titanium Appcelerator Studio中发现了一个错误,当联系人对象具有电话号码的自定义标签时,phone对象返回undefined

不幸的是,他们可能需要更多时间来解决此问题,但是好消息是我可以修改Objective-C的构建类,这是提供人员信息的方法。

/build/iphone/classes/TiContactsPerson.m中的

+(NSDictionary*)multiValueLabels
{
    if (multiValueLabels == nil) {
        multiValueLabels =
            [[NSDictionary alloc] initWithObjectsAndKeys:(NSString*)kABHomeLabel,@"home", // Generic labels
             kABWorkLabel,@"work",
             kABOtherLabel,@"other",
             kABPersonPhoneMobileLabel,@"mobile", // Phone labels
             kABPersonPhonePagerLabel,@"pager",
             kABPersonPhoneWorkFAXLabel,@"workFax",
             kABPersonPhoneMainLabel,@"main",
             kABPersonPhoneIPhoneLabel,@"iPhone",
             kABPersonPhoneHomeFAXLabel,@"homeFax",
             kABPersonSocialProfileServiceFacebook,@"facebookProfile",// Social Profile Labels
             kABPersonSocialProfileServiceFlickr,@"flickrProfile",
             kABPersonSocialProfileServiceGameCenter,@"gameCenterProfile",
             kABPersonSocialProfileServiceLinkedIn,@"linkedInProfile",
             kABPersonSocialProfileServiceMyspace,@"myspaceProfile",
             kABPersonSocialProfileServiceSinaWeibo,@"sinaWeiboProfile",
             kABPersonSocialProfileServiceTwitter,@"twitterProfile",
             kABPersonInstantMessageServiceAIM,@"aim", // IM labels
             kABPersonInstantMessageServiceICQ,@"icq",
             kABPersonInstantMessageServiceJabber,@"jabber",
             kABPersonInstantMessageServiceMSN,@"msn",
             kABPersonInstantMessageServiceYahoo,@"yahoo",
             kABPersonInstantMessageServiceQQ,@"qq",
             kABPersonInstantMessageServiceSkype,@"skype",
             kABPersonInstantMessageServiceGoogleTalk,@"googletalk",
             kABPersonInstantMessageServiceGaduGadu,@"gadugadu",
             kABPersonInstantMessageServiceFacebook,@"facebook",
             kABPersonMotherLabel,@"mother", // Relation labels
             kABPersonFatherLabel,@"father",
             kABPersonParentLabel,@"parent",
             kABPersonSisterLabel,@"sister",
             kABPersonBrotherLabel,@"brother",
             kABPersonChildLabel,@"child",
             kABPersonFriendLabel,@"friend",
             kABPersonSpouseLabel,@"spouse",
             kABPersonPartnerLabel,@"partner",
             kABPersonManagerLabel,@"manager",
             kABPersonAssistantLabel,@"assistant",
             kABPersonAnniversaryLabel,@"anniversary", // Date label
             kABPersonHomePageLabel,@"homepage", // URL label
             nil];
    }
    return multiValueLabels;
}

它不包括用户为电话号码设置的自定义标签,这就是为什么当联系人设置了自定义标签时,phone数组返回undefined的原因。

我的问题是如何获取用户创建的所有自定义标签并推送
他们里面的数组?

注意:我已将此错误报告给appiraerator Jira。

任何建议都非常感谢

最佳答案

自SDK 5.1.0起,票证https://jira.appcelerator.org/browse/TIMOB-19739已关闭并释放。

10-04 11:03