iOS9 在调用 shouldPerformDefaultActionForPerson 之前显示本机拨号程序

iOS9 native dialler is shown before shouldPerformDefaultActionForPerson is called

我刚刚注意到升级到 iOS9 后我的应用程序出现了不同的行为。我有一个显示 phone 的设备联系人的视图。

我的代码如下:

if (... == YES)
    {
        ABRecordSetValue(aContact, kABPersonEmailProperty, email, &anError);
        if (anError == NULL)
        {
            ABUnknownPersonViewController *picker = [[ABUnknownPersonViewController alloc] init];
            picker.unknownPersonViewDelegate = self;
            picker.displayedPerson = aContact;
            picker.allowsAddingToAddressBook = YES;
            picker.allowsActions = YES;
            picker.alternateName = @"John Appleseed";
            picker.title = @"John Appleseed";
            picker.message = @"Company, Inc";

            [self.navigationController pushViewController:picker animated:YES];
        }

然后我使用委托来做一些决定

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person 
                                property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
    {
        //make decisions 
        return YES or NO;
    }

用户点按 phone 号码。

在IOS8 >>代码到达shouldContinueAfterSelectingPerson然后原生拨号器出现

In IOS9 >> 本机拨号器出现在代码到达 shouldContinueAfterSelectingPerson 之前。

有什么办法解决吗?

我遇到了同样的问题。我注意到的是,如果您在委托方法中进行某些计算(显然需要一些时间来进行该计算)并且会调用本机拨号器。

所以,为了避免这个问题,我立即从这个委托方法返回 NO 并在不同的线程中执行我的计算。这当然是一种解决方法,希望该问题在 iOS 的下一个版本中得到解决。