作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
要求:我将一些联系人连同一张图片(尺寸与设备相同)保存到用户的 iPhone 中。我希望联系人在该设备上调用时全屏显示此图片。
注意示例: Truecaller当来电者被识别为垃圾邮件
时,iOS 应用显示为红色图像代码:这是我用来保存联系人数据的代码。我正在使用 Contacts.framework
CNMutableContact *newContact = [CNMutableContact new];
newContact.imageData = UIImagePNGRepresentation([UIImage imageNamed:@"blue_bg.png"]);
newContact.contactType = CNContactTypePerson;
newContact.givenName = user.firstName;
newContact.middleName = user.middleName;
newContact.familyName = user.lastName;
NSArray *numbers = [[NSArray alloc] initWithArray:@[[CNLabeledValue labeledValueWithLabel:@"Main" value:[CNPhoneNumber phoneNumberWithStringValue:user.mobileNumber.stringValue]]]];
newContact.phoneNumbers = numbers;
CNContactStore *store = [CNContactStore new];
CNSaveRequest *saveReq = [CNSaveRequest new];
[saveReq addContact:newContact toContainerWithIdentifier:nil];
NSError *error = nil;
[store executeSaveRequest:saveReq error:&error];
if (error) {
NSLog(@"Contact Save ERROR: %@", error.localizedDescription);
}
当前情况:我在 iOS Contacts App
中收到这张图片,但当该用户在 iPhone 上调用时它没有显示。 Truecaller 是如何做到的?我在这里错过了什么?
最佳答案
如果该图像显示在“通讯录”应用中,那么当您接到那个人的电话时,它应该会显示。
关于ios - 保存图片为联系人图片,来电显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38208946/
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
要求:我将一些联系人连同一张图片(尺寸与设备相同)保存到用户的 iPhone 中。我希望联系人在该设备上调用时全屏显示此图片。 注意示例: Truecaller当来电者被识别为垃圾邮件时,iOS 应用
我是 android 开发的新手。我开发了一个应用程序,其中有个人通讯录。我可以从该目录调用,但如果有人从我的个人目录中存在的同一个号码调用,如何在调用者 ID 中显示联系信息。 如果设备联系人列表中
我是一名优秀的程序员,十分优秀!