summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Minakov <naithar@icloud.com>2020-06-22 16:24:16 +0300
committerSergey Minakov <naithar@icloud.com>2020-06-23 12:48:44 +0300
commit488879f52bbd7ebf51715433a0dc8ba50849c93e (patch)
treee81c0fb3a9271163dda4711d94ec96359b23c3a9
parent6a01fbc9a79e6fdfcf38ac7ce3bd6156d1bf25d4 (diff)
Export: Fix iOS enabling push notifications capability
-rw-r--r--misc/dist/ios_xcode/godot_ios/godot_ios.entitlements3
-rw-r--r--platform/iphone/export/export.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
index 903def2af5..c9b58a85cf 100644
--- a/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
+++ b/misc/dist/ios_xcode/godot_ios/godot_ios.entitlements
@@ -2,7 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>aps-environment</key>
- <string>development</string>
+$entitlements_push_notifications
</dict>
</plist>
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index aadc60175b..194e71c9de 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -343,6 +343,9 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_
} else if (lines[i].find("$push_notifications") != -1) {
bool is_on = p_preset->get("capabilities/push_notifications");
strnew += lines[i].replace("$push_notifications", is_on ? "1" : "0") + "\n";
+ } else if (lines[i].find("$entitlements_push_notifications") != -1) {
+ bool is_on = p_preset->get("capabilities/push_notifications");
+ strnew += lines[i].replace("$entitlements_push_notifications", is_on ? "<key>aps-environment</key><string>development</string>" : "") + "\n";
} else if (lines[i].find("$required_device_capabilities") != -1) {
String capabilities;
@@ -1066,6 +1069,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
files_to_parse.insert("godot_ios/dummy.cpp");
files_to_parse.insert("godot_ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata");
files_to_parse.insert("godot_ios.xcodeproj/xcshareddata/xcschemes/godot_ios.xcscheme");
+ files_to_parse.insert("godot_ios/godot_ios.entitlements");
IOSConfigData config_data = {
pkg_name,