Reputation: 939
I’m building an Expo-managed iOS app and need to allow my app to accept multiple images shared directly from Apple Photos via the iOS Share Sheet.
I use eas build --platform ios --profile development
to test the app on a real device (not via the Expo Go app) so that new features are supported.
Here’s my app.config.js
:
import { ExpoConfig, ConfigContext } from "@expo/config";
import { version } from "./package.json";
const IS_DEV = process.env.APP_VARIANT === "development";
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: IS_DEV ? "Calorily Debug" : "Calorily",
slug: "calorily",
version: version,
orientation: "portrait",
ios: {
bundleIdentifier: "com.calorily.app",
supportsTablet: true,
usesAppleSignIn: true,
infoPlist: {
CFBundleDocumentTypes: [
{
CFBundleTypeName: "Images",
LSHandlerRank: "Alternate",
LSItemContentTypes: ["public.image", "public.jpeg", "public.png"],
CFBundleTypeRole: "Viewer",
LSSupportsMultipleItems: true,
},
],
NSExtensionActivationRule: {
NSExtensionActivationSupportsImageWithMaxCount: 10,
},
NSPhotoLibraryUsageDescription:
"This app accesses your photos to analyze your meals.",
LSSupportsOpeningDocumentsInPlace: true,
UISupportsDocumentBrowser: true,
UTImportedTypeDeclarations: [
{
UTTypeIdentifier: "com.calorily.app",
UTTypeTagSpecification: {
"public.mime-type": "image/*",
"public.filename-extension": ["jpg", "jpeg", "png"],
},
LSHandlerRank: "Alternate",
CFBundleTypeRole: "Viewer",
LSSupportsMultipleItems: true,
},
],
},
},
plugins: [
[
"expo-image-picker",
{
photosPermission: "This app accesses your photos to analyze your meal.",
cameraPermission: "This app accesses your camera to analyze your meal.",
},
],
],
});
NSExtensionActivationRule
to support up to 10 images.CFBundleDocumentTypes
with "LSSupportsMultipleItems": true
.eas build --platform ios --profile development
(not with the Expo Go app).Upvotes: 0
Views: 61