summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2019-12-03 12:06:54 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2019-12-03 12:06:54 +0200
commitccf8778e86a508e9d81f132332460c1c1acb8a96 (patch)
treec74b73fa4dfe5ff97a4db466819210d8e30f128a
parenta74f0fd4cf528b8dfac5e9a642a7feca591c9e84 (diff)
[iOS] Add export options to control external access to user data.
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist4
-rw-r--r--platform/iphone/export/export.cpp7
2 files changed, 11 insertions, 0 deletions
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
index e7c4f8f340..add2f6c084 100644
--- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist
@@ -28,6 +28,10 @@
<string>$version</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>LSSupportsOpeningDocumentsInPlace</key>
+ $docs_in_place
+ <key>UIFileSharingEnabled</key>
+ $docs_sharing
<key>UIRequiredDeviceCapabilities</key>
<array>
$required_device_capabilities
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 5a888f63ae..82c9508fdb 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -275,6 +275,9 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/in_app_purchases"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/push_notifications"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data/accessible_from_files_app"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data/accessible_from_itunes_sharing"), false));
+
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the camera"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use the microphone"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/photolibrary_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need access to the photo library"), ""));
@@ -364,6 +367,10 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
strnew += lines[i].replace("$linker_flags", p_config.linker_flags) + "\n";
} else if (lines[i].find("$cpp_code") != -1) {
strnew += lines[i].replace("$cpp_code", p_config.cpp_code) + "\n";
+ } else if (lines[i].find("$docs_in_place") != -1) {
+ strnew += lines[i].replace("$docs_in_place", ((bool)p_preset->get("user_data/accessible_from_files_app")) ? "<true/>" : "<false/>") + "\n";
+ } else if (lines[i].find("$docs_sharing") != -1) {
+ strnew += lines[i].replace("$docs_sharing", ((bool)p_preset->get("user_data/accessible_from_itunes_sharing")) ? "<true/>" : "<false/>") + "\n";
} else if (lines[i].find("$access_wifi") != -1) {
bool is_on = p_preset->get("capabilities/access_wifi");
strnew += lines[i].replace("$access_wifi", is_on ? "1" : "0") + "\n";