2

When "Photo Library" permission prompted & declined.

Still able to open library & choose images in iOS.

tested on iOS version: 15.5

dependencies used:

"react-native-image-picker": "^4.8.3"

Here is my code.

import { launchImageLibrary } from "react-native-image-picker";

launchImageLibrary(
        {
            mediaType: "photo",
            quality: 0.6,
            includeBase64: true
        },
        response => {
            console.log("Response = ", response);
            if (response.didCancel) {
                console.log("User cancelled image picker");
                alert("User cancelled image picker");
            } else if (response.errorCode) {
                console.log("ImagePicker ErrorCode: ", response.errorCode);
                alert("ImagePicker ErrorCode: " + response.errorCode);
            } else if (response.errorMessage) {
                console.log("ImagePicker ErrorMessage: ", response.errorMessage);
                alert("ImagePicker ErrorMessage: " + response.errorMessage);
            } else {
                let source = response;
                const uri = response?.assets && response.assets[0].uri;
                const base64 = response?.assets && response.assets[0].base64;
                const fileSize = response?.assets && response.assets[0].fileSize;
                console.log("uri: ", uri);
                console.log("base64: ", base64);
                console.log("fileSize: ", (fileSize / (1024 * 1024)).toFixed(2), "MB");
            }
        }
    );

Why is this happening? Does anyone successfully submitted & passed the AppStore review? Are there any chances of getting rejected?

AbhinayMe
  • 2,399
  • 1
  • 20
  • 21
  • 1
    I don't know about rejection chances, But my suggestion is for the safer side, you should ask permission locally before opening the image library. – Jaimin Bhut Jun 22 '22 at 07:28
  • @JaiminBhut I'm asking the permission but I'm worried that I can choose the photos after the permission is denied. – AbhinayMe Jun 22 '22 at 07:29
  • I think this answer will help you: https://stackoverflow.com/questions/59465759/i-am-able-to-get-images-from-photo-gallery-even-though-permission-is-denied-in-i – Jaimin Bhut Jun 22 '22 at 07:37

1 Answers1

0

The permission is only for android, for IOS your method is correct, the app store will not reject your app. but in Android, your code does not work.