Skip to content

[🐛] Unable to change photos available to attachment picker after dismissing initial dialog #2240

@josh-

Description

@josh-

Issue

When an iOS user has granted limited photo library access to an app, they are given the option to change the visible photos when opening the photo picker, however if this resulting dialog is then dismissed, there is no way to change the visible photos in-app again until the app is re-opened.

Steps to reproduce

Steps to reproduce the behavior:

  1. Provide limited library access to an app using stream-chat-react-native
    • the resulting screen in Settings.app > Privacy & Security > Photos > APP_NAME will look like this:
  1. Open a channel in your app
  2. Click on the attachment icon
    • observe the following popup allowing you to select which photos should be visible:
  1. Press "Keep Current Selection"
  2. Observe that there is now no way to change the selected photos from the photo library, until the app is re-opened and the popup from (4.) is shown again:

Expected behavior

Instead of always showing the popup when opening the attachment picker for the first time, I believe that the attachment picker should instead allow the user to trigger photo selection, which is what is done in other apps.

For example, Facebook Messenger:

Or Slack:

Project Related Information

Customization

Click To Expand

# N/A

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Click To Expand

package.json:

"expo-media-library": "15.4.1",
"@react-native-community/netinfo": "9.3.10",
"expo-file-system": "15.4.3",
"react-native-gesture-handler": "2.12.1",
"expo-image-picker": "14.3.2",
"expo-image-manipulator": "11.3.0",
"react-native-reanimated": "3.3.0",
"react-native-svg": "13.9.0",
"stream-chat-expo": "5.16.0",

react-native info output:

System:
  OS: macOS 13.5.2
  CPU: (10) arm64 Apple M1 Max
  Memory: 75.44 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.0
    path: /private/var/folders/9y/jsk3j2317c7bpdl61ldr05rc0000gp/T/xfs-6a747772/node
  Yarn:
    version: 3.6.3
    path: /private/var/folders/9y/jsk3j2317c7bpdl61ldr05rc0000gp/T/xfs-6a747772/yarn
  npm:
    version: 9.5.1
    path: ~/.nvm/versions/node/v18.16.0/bin/npm
  Watchman:
    version: 2023.09.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.9787799
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
  • Platform that you're experiencing the issue on:
    • x] iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:
    • 5.16.0
  • Device/Emulator info:
    • I am using a physical device
    • OS version: iOS 17
    • Device/Emulator: e.g. iPhone 13 Pro

Additional context

I believe the underlying code that triggers the initial access prompt is here:

useEffect(() => {
if (
!attemptedToLoadPhotosOnOpenRef.current &&
selectedPicker === 'images' &&
endCursorRef.current === undefined &&
currentIndex > -1 &&
!loadingPhotos
) {
getMorePhotos();

Screenshots

Click To Expand

Added above.


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions