Ios 什么能打开窗户
我需要知道您是否可以使用“abid=+282727”命令从whatapps打开联系人Ios 什么能打开窗户,ios,whatsapp,Ios,Whatsapp,我需要知道您是否可以使用“abid=+282727”命令从whatapps打开联系人 是的,你可以,但要知道阿比德不是联系人的电话号码。 是的 尝试使用此代码打开地址簿中名为“您的姓名”的联系人的whatsapp // Fetch the address book ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL,NULL); dispatch_semaphore_t sema = dis
是的,你可以,但要知道阿比德不是联系人的电话号码。 是的 尝试使用此代码打开地址簿中名为“您的姓名”的联系人的whatsapp
// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL,NULL);
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
dispatch_semaphore_signal(sema);
});
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
// find user
CFStringRef searchQuery = CFSTR("Your Contact Name");
CFArrayRef array = ABAddressBookCopyPeopleWithName (addressBook,searchQuery);
int items = CFArrayGetCount(array);
NSLog(@"found %i persons",items);
int abid = 0;
for (int i = 0; i < items; i++)
{
ABRecordRef person = CFArrayGetValueAtIndex(array, i);
abid = ABRecordGetRecordID(person);
NSLog(@"found person %i ",abid);
break;
}
if (abid > 0)
{
NSString* url = [NSString stringWithFormat:@"whatsapp://send?abid=%i&text=Hola",abid];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
//获取地址簿
ABAddressBookRef addressBook=ABAddressBookCreateWithOptions(NULL,NULL);
dispatch\u semaphore\u t sema=dispatch\u semaphore\u create(0);
ABAddressBookRequestAccessWithCompletion(addressBook,^(已授予bool,CFErrorRef错误){
调度信号量信号(sema);
});
调度信号量等待(永远调度时间);
//查找用户
CFStringRef searchQuery=CFSTR(“您的联系人姓名”);
CFArrayRef数组=ABAddressBookCopyPeopleWithName(addressBook,searchQuery);
int items=CFArrayGetCount(数组);
NSLog(@“找到%i个人”,项目);
int-abid=0;
对于(int i=0;i0)
{
NSString*url=[NSString stringWithFormat:@”whatsapp://send?abid=%i&text=Hola“,阿比德];
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:url]];
}
// Fetch the address book
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL,NULL);
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
dispatch_semaphore_signal(sema);
});
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
// find user
CFStringRef searchQuery = CFSTR("Your Contact Name");
CFArrayRef array = ABAddressBookCopyPeopleWithName (addressBook,searchQuery);
int items = CFArrayGetCount(array);
NSLog(@"found %i persons",items);
int abid = 0;
for (int i = 0; i < items; i++)
{
ABRecordRef person = CFArrayGetValueAtIndex(array, i);
abid = ABRecordGetRecordID(person);
NSLog(@"found person %i ",abid);
break;
}
if (abid > 0)
{
NSString* url = [NSString stringWithFormat:@"whatsapp://send?abid=%i&text=Hola",abid];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}