1

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?

cateof
  • 6,608
  • 25
  • 79
  • 153
  • I see the same thing in ABPersonViewController when tapping on a phone number. The native dialer will appear before the delegate is called, but not every time. It seems to happen the first time after the app is opened. – Mike C. Oct 07 '15 at 05:21
  • For me it is everytime. – cateof Oct 07 '15 at 10:16

1 Answers1

2

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.

Jyotirmoy
  • 710
  • 6
  • 12