How do I handle adding these descriptions in Ionic in a way that I can check into the repo and will be included automatically on build?
1 Answer
Try putting something like this in your /hooks/after_prepare
directory with e.g. filename 030_add_ios_usage_descriptions.sh
:
#!/bin/bash
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Delete :NSPhotoLibraryUsageDescription
Add :NSPhotoLibraryUsageDescription string "For meal photos"
Delete :NSCameraUsageDescription
Add :NSCameraUsageDescription string "For meal photos"
Delete :NSMicrophoneUsageDescription
Add :NSMicrophoneUsageDescription string "For voice notes"
EOF
while read line
do
/usr/libexec/PlistBuddy -c "$line" $PLIST
done
true
You may also need to run chmod +x
on the file.