iosiphoneuitableviewios9abpersonviewcontroller

iOS9 native dialler is shown before shouldPerformDefaultActionForPerson is called


I just noticed different behaviour in my app after upgrading to iOS9. I have a view that shows the device contacts of the phone.

My code is the following:

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];
        }

Then I use the delegate to make a few decisions

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

The user taps in a phone number.

In IOS8 >> Code reaches shouldContinueAfterSelectingPerson and then the native dialler appears

In IOS9 >> The native dialler appears BEFORE the code reaches shouldContinueAfterSelectingPerson.

Any way to resolve it?


Solution

  • I am facing the same issue. What I have noticed is, if you do certain calculations within the delegate method (it obviously takes some time to do that calculation) and the native dialer gets called.

    So, to avoid this problem, I am immediately returning NO from this delegate method and performing my calculations in a different thread. This is of course a workaround, hope the issue is fixed in the next release of iOS.