Bug 23374 - ABPeoplePickerNavigationController SelectPerson Event not firing
Summary: ABPeoplePickerNavigationController SelectPerson Event not firing
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.2.0
Hardware: PC Windows
: Normal normal
Target Milestone: Untriaged
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2014-09-25 11:52 UTC by AndyW
Modified: 2015-01-05 15:30 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description AndyW 2014-09-25 11:52:16 UTC
ABPeoplePickerNavigationController exposes a SelectPerson Event, this no longer fires.

This can be seen on iOS 8 and the Xamarin sample at: 

http://developer.xamarin.com/recipes/ios/shared_resources/contacts/choose_a_contact/

One work around is to use the ABPeoplePickerNavigationControllerDelegate which exposes two SelectPerson() overrides, but using these, dismisses the ABPeoplePickerNavigationController. 

Not sure if there's a separate problem here with the ShouldContinue, as these are never called either.

I did ask up on the forum, but my post was never approved.
Comment 1 Sebastien Pouliot 2014-09-25 13:35:34 UTC
@Alex you had a recent look in this code, can you check on this ? thanks!
Comment 2 Alex Soto [MSFT] 2014-09-29 15:58:25 UTC
Turned out to be a little messy, still in progress, current workaround is to use the delegate pattern.
Comment 3 AndyW 2014-09-30 05:46:05 UTC
Hi Alex,

Using the Delegate results in the ABPeoplePickerNavigationController dismissing itself when the SelectPerson method is called. Therefore you cannot continue, to the Persons details.

I was expecting the ShouldContinue overrides to sort this, but they never appear to fire.

Thanks, Andy
Comment 4 Alex Soto [MSFT] 2014-10-13 12:40:46 UTC
QA: Fixed in monotouch master 949e6f40555df7eb19f37d464c9e083c14531c92

Andy: Yup that is the expected behaviour, if you want to get person details you need to override (iOS8 +)

> public override void DidSelectPerson (ABPeoplePickerNavigationController peoplePicker, ABPerson selectedPerson, int propertyId, IntPtr abMultiValueIdentifier)

In a future release of Xamarin.iOS ShouldContinue and SelectPerson will have the expected behaviour and this will be transparent to you. In them ran time you can use the delegate pattern as a workaround.
Comment 8 Alex Soto [MSFT] 2015-01-05 15:30:06 UTC
Hello Ram

This has been fixed in a2e66a08eaf4a6979f1fa78bc543b1432c4d1981

The PeoplePickerSample you need to test is in the unified branch

https://github.com/xamarin/monotouch-samples/tree/monotouch-8.6-unified-api/ios8/PeoplePicker

Hope this helps

Alex