Esri / data-collection-ios

Mobile data collection app using the iOS Runtime SDK.
https://developers.arcgis.com/
Apache License 2.0
25 stars 26 forks source link

Mhd/504 image picker #276

Closed mhdostal closed 3 years ago

mhdostal commented 3 years ago

This adds an additional check for iOS 14 authorization status after the user selects the desired permissions in-app. The result of picking "Selected Photos" as the new permissions is the same as if the user picked "None":

Screen Shot 2021-02-22 at 11 07 26 AM

mhdostal commented 3 years ago

@esreli Yes, I agree more work can be done to improve this. Since it's going to be more involved, are you OK if we push this off until v1.3?

esreli commented 3 years ago

@esreli Yes, I agree more work can be done to improve this. Since it's going to be more involved, are you OK if we push this off until v1.3?

I think the extensive work can be put off yes. I do think we can use this opportunity to check the auth status for if the user has chosen 'selected photos' so that we can let them know why they don't have access to the picker when they thought they should. Am I making sense here?

mhdostal commented 3 years ago

Am I making sense here?

Yes, you are, I think your proposal is good. I'll craft the alert and ping you when it's done.

mhdostal commented 3 years ago

Here's the new alert. I've made the code changes as well to check for iOS 14 and .limited status when displaying the settings alert.

Screen Shot 2021-02-23 at 12 23 53 PM

mhdostal commented 3 years ago

If this is the problem, we might be able to control when the picker is presented in code rather then the default system presentation behavior via the plist permissions key, PHPhotoLibraryPreventAutomaticLimitedAccessAlert.

I tried that and it had no affect for our use case; it still showed the Select Photos... options and displayed the image selection view when selected. According to the docs: "By default, the system automatically prompts the user to update their limited library selection once per app life cycle." This seems to indicate that it will prevent asking the user to update their selection, rather than preventing them from making the initial selection.

esreli commented 3 years ago

If this is the problem, we might be able to control when the picker is presented in code rather then the default system presentation behavior via the plist permissions key, PHPhotoLibraryPreventAutomaticLimitedAccessAlert.

I tried that and it had no affect for our use case; it still showed the Select Photos... options and displayed the image selection view when selected. According to the docs: "By default, the system automatically prompts the user to update their limited library selection once per app life cycle." This seems to indicate that it will prevent asking the user to update their selection, rather than preventing them from making the initial selection.

I guess there's no way around it then. Good thing we'll tackle this soon in v.next-1.3!