Branch handling for photo books is different between debug and release modes

I wonder why the debugging and release code branches are divided when checking Photo Library inside sendbird UIKit. In debug mode, only Photo Library permission is requested and the gallery can be opened, but in release mode, both Photo Library and Media Library (Apple Music) must be granted permission to operate. Ideally, I think the debug and release behaviors should be the same, but is there a reason for splitting these branches?

Below is the code.

const mediaLibraryPermissions: Permission[] ={
    android: getAndroidStoragePermissionsByAPILevel(permissionModule),
    default: [],

async hasMediaLibraryPermission(): Promise<boolean> {
      const status = await permissionModule.checkMultiple(mediaLibraryPermissions);
      if (
        __DEV__ &&
        Platform.OS === 'ios' &&
        status['ios.permission.MEDIA_LIBRARY'] === 'unavailable' &&
        status['ios.permission.PHOTO_LIBRARY'] === 'granted'
      ) {
        return true;
      return nativePermissionGranted(status);


import type { Permission, PermissionStatus } from 'react-native-permissions';

const nativePermissionGranted = (stats: Record<Permission, PermissionStatus>, limitedCallback?: () => void) => {
  return Object.values(stats).every((result) => {
    if (result === 'granted') return true;
    if (result === 'limited') {
      return true;
    return false;

export default nativePermissionGranted;

I wonder why the branch processing is divided.